Laravel 5.6 中文文档议, 而业务逻辑应该放到 services 这种目录之下。所以推荐大家在生成模型类的时候指定生成到 app/Models 目录下: php artisan make:model Models/Test 根目录 App 目录 app 目录包含了应用的核心代码,注意不是框架的核心代码,框架的核心代码在 /vendor/laravel/framework 里面,此外你为应用编写的代码绝大 artisan storage:link 命令生成这个软链接。 Tests 目录 tests 目录包含自动化测试文件,其中默认已经提供了一个开箱即用的 PHPUnit 示例;每一个测试类都要以 Test 开头,你可以通过 phpunit 或 php vendor/bin/phpunit 命令来运行测试。 Vendor 目录 vendor 目录包含了应用所有通过 Composer 加载的依赖。 rs\etc\hosts,添加方式如下: 192.168.10.10 homestead.test 确保 IP 地址和你的 Homestead.yaml 文件中列出的一致,一旦你将域名添加到 hosts 文件,就可以在浏览器中通过该域名访问站点了: http://homestead.test 注:在真正可以访问之前还需要通过 Vagrant 启动虚拟机上的 Homestead 盒子。0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 6.0 中文文档什么异议,而业务逻辑应该放到 services 这种目录之下。所以推荐 大家在生成模型类的时候指定生成到 app/Models 目录下: php artisan make:model Models/Test 根目录 应用目录 app 目录包含了应用的核心代码,注意不是框架的核心代码,框架的 核心代码在 /vendor/laravel/framework 里面,此外你为应用编写 的代码绝大多数也会放到这里,当然,如果你基于 artisan storage:link 命令生成这个软链接。 测试目录 tests 目录包含自动化测试文件,其中默认已经提供了一个开箱即用 的 PHPUnit 示例;每一个测试类都要以 Test 开头,你可以通 过 phpunit 或 php vendor/bin/phpunit 命令来运行测试。 Vendor 目录 vendor 目录包含了应用所有通过 Composer 加载的依赖。 射到 Homestead 虚拟机的指定目录,Homestead.yaml 中默认已经 配置了一个示例站点。和共享文件夹一样,你可以配置多个站点: sites: - map: homestead.test to: /home/vagrant/project1/public 如果你是在 Homestead 盒子启动之后进行了上述修改,需要运 行 vagrant reload --provision0 码力 | 1442 页 | 14.66 MB | 1 年前3
The Laravel Handbook
around since 2011, well before modern frontend tools like React and Vue.js existed. It stood the test of time. And it evolved over the years to a serious and complete solution for building Web Applications file resources/views/welcome.blade.php : You can clear all the content of this file, and typetest
into it. Save (cmd-s or ctrl-s) and reload in the browser, the homepage content will switch routes/web.php , add: //... Route::get('/test', function () { return view('welcome'); }); This will render the welcome view also when the /test route is called: 15 You can show a different0 码力 | 111 页 | 14.25 MB | 1 年前3
Laravel 3.2 Documentation................................................................................... 74 Creating Test Classes ......................................................................................... Route::get('welcome', array('as' => 'home.welcome', 'uses' => 'home@index')); CLI Route Testing You may test your routes using Laravel's "Artisan" CLI. Simple specify the request method and URI you want to { // Validate the location instance... } } Great! Now we have a great way to test our validation in isolation from our controllers and routes! So, we've validated the location and0 码力 | 139 页 | 1.13 MB | 1 年前3
Laravel 5.0 Documentation
Structures iii. Extending Blade xxi. Unit Testing i. Introduction ii. Defining & Running Tests iii. Test Environment iv. Calling Routes From Tests v. Mocking Facades vi. Framework Assertions vii. Helper bug reports. "Bug reports" may also be sent in the form of a pull request containing a failing unit test. However, if you file a bug report, your issue should contain a title and a clear description of Other Blade Control Structures Extending Blade Unit Testing Introduction Defining & Running Tests Test Environment Calling Routes From Tests Mocking Facades Framework Assertions Helper Methods Refreshing0 码力 | 242 页 | 1.44 MB | 1 年前3
Learning Laraveltask 174 Setting the scheduler to run 174 Chapter 60: Testing 176 Examples 176 Introduction 176 Test without middleware and with a fresh database 176 Database transactions for mutliple database connection architectural pattern as well as the PSR-2 coding standard, and the PSR-4 autoloading standard. Running a Test Driven Development (TDD) in Laravel is fun and easy to implement. Hosted on GitHub and available make:request Create a new form request class make:seeder Create a new seeder class make:test Create a new test class migrate:install Create the migration repository migrate:refresh Reset and re-run0 码力 | 216 页 | 1.58 MB | 1 年前3
《Slides Dev Web》 03. Laravel
artisan list • Extensible29 Premiers pas • Routes30 – Ajouter une route /test – Ajouter un paramètre qui sera affiché : /test/param – Utiliser une vue pour cette route – Lister les routes avec la commande commande artisan . . . • Contrôleurs31 – Ajouter un contrôleur : Test – Lui ajouter une action : index – Ajouter la route correspondante : /test/index . . . • Vues32 – Ajouter une vue Blade (.blade.php)0 码力 | 8 页 | 224.34 KB | 1 年前3
Laravel 5.3 中文文档artisan storage:link 命令生成这个软链接。 Tests 目录 tests 目录包含自动化测试,其中已经提供了一个开箱即用的 PHPUnit 示例;每一个测试类都要 以 Test 开头,你可以通过 phpunit 或 php vendor/bin/phpunit 命令来运行测试。 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel Cache::get 方法以我们期望的方式被调用: use Illuminate\Support\Facades\Cache; /** * A basic functional test example. * * @return void */ public function testBasicExample() { Cache::shouldReceive('get') 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 88 /** * A basic functional test example. * * @return void */ public function testBasicExample() { Cache::shouldReceive('get')0 码力 | 691 页 | 9.37 MB | 1 年前3
《Slides Dev Web》 06. HTTP & AJAX
Asynchrone : Non bloquant • Non standard => différentes implémentations 8https://www.ashleyit.com/rs/jsrs/test.htm 9https://web.archive.org/web/20100916110710/http://depressedpress.com/Content/Development/JavaScript/Articl js">Let jQuery AJAX Change This Text
0 码力 | 11 页 | 91.09 KB | 1 年前3
Laravel 5.2 中文文档* * @return mixed */ public function handle() { Redis::subscribe(['test-channel'], function($message) { echo $message; }); } } 现在,我们可以使用 publish publish 发布消息到该频道: Route::get('publish', function () { // 路由逻辑... Redis::publish('test-channel', json_encode(['foo' => 'bar '])); }); 通配符订阅 使用 psubscribe 方法,你可以订阅到一个通配符定义的频道,这在所有相应频道上获取所 ing 环境变量可以在 phpunit.xml 文 件中配置。 1.2 定义&运行测试 要创建一个新的测试用例,可以使用如下 Artisan 命令: php artisan make:test UserTest 该命令将会在 tests 目录下生成一个新的 UserTest 类。然后你可以使用 PHPUnit 定义测 试方法。要运行测试,简单从终端执行 phpunit 命令即可:0 码力 | 377 页 | 4.56 MB | 1 年前3
共 13 条
- 1
- 2













