Learning LaravelRunning a Seeder 60 Creating a Seed 60 Inserting Data using a Seeder 60 Inserting data with a Model Factory 61 Seeding with MySQL Dump 61 Using faker And ModelFactories to generate Seeds 62 Chapter 65 Chapter 20: Directory Structure 68 Examples 68 Change default app directory 68 Override Application class 68 Calling the new class 68 Composer 69 Change the Controllers directory 69 Chapter 21: Types 77 One to Many 77 One to One 78 How to associate between two models (example: User and Phone model) 78 Explanation 79 Many to Many 79 Polymorphic 80 Many To Many 82 Chapter 23: Eloquent: Accessors0 码力 | 216 页 | 1.58 MB | 1 年前3
Laravel 3.2 DocumentationDifferent? ....................................................................................... 1 Application Structure .................................................................................... ........................................................................... 112 Authentication Model ................................................................................................. ....................................................................................... 118 Application Configuration (More Information) .............................................................0 码力 | 139 页 | 1.13 MB | 1 年前3
The Laravel Handbook
stuff for you. For example we’ll use it to “scaffold” models without having to create files by hand. Open your browser and you’ll see the default welcome screen of a Laravel app: 7 If you have troubles troubles reaching this stage, the official documentation has great guides for macOS, Linux and Windows. Open the newly created project folder in VS Code. This should be the file structure: 8 While you’re you see in the browser. 11 Open the routes folder and you’ll 4 files. Open web.php : This is the code that displays the sample home page of the Laravel application: 12 We made a request to the0 码力 | 111 页 | 14.25 MB | 1 年前3
Laravel 5.0 Documentation
Protection iii. Method Spoofing iv. Route Parameters v. Named Routes vi. Route Groups vii. Route Model Binding viii. Throwing 404 Errors ii. Middleware i. Introduction ii. Defining Middleware iii Overview iii. Focus On Service Providers vi. Application Structure i. Introduction ii. The Root Directory iii. The App Directory iv. Namespacing Your Application 6. Services i. Authentication i. Introduction Tests v. Mocking Facades vi. Framework Assertions vii. Helper Methods viii. Refreshing The Application xxii. Validation i. Basic Usage ii. Controller Validation iii. Form Request Validation iv0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 6.0 中文文档query... no mass assignment protection or ev ents... $post->user()->update(['foo' => 'bar']); // Model update... provides mass assignment protection and events... $post->user->update(['foo' => 'bar']); 它,创建缺陷报告是为了帮你自己和别人走上修复问题之路。 Laravel 源码通过 Github 进行管理,每一个 Laravel 项目都有其对 应的代码库: Laravel Application Laravel Art Laravel Documentation Laravel Cashier Laravel Cashier for Braintree 本文档由学院君提供 Laravel 中文学习资源:https://xueyuanjun.com 38 如果你需要定义一个包含空格的环境变量值,可以通过将字符串放到 双引号中来实现: APP_NAME="My Application" 获取环境变量配置值 应用每次接受请求时,.env 中列出的所有配置及其对应值都会被载 入到 PHP 超全局变量 $_ENV 中,然后你就可以在应用中通过辅助 函数 env() 来获取这些配置值。实际上,如果你去查看0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.6 中文文档ovider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Bl ovider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Pa 目录用于存放与数据库交互的模型类应该没有什么异议, 而业务逻辑应该放到 services 这种目录之下。所以推荐大家在生成模型类的时候指定生成到 app/Models 目录下: php artisan make:model Models/Test 根目录 App 目录 app 目录包含了应用的核心代码,注意不是框架的核心代码,框架的核心代码在 /vendor/laravel/framework 里面,此外你为应用编写的代码绝大0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 5.2 中文文档Route::get('/user/{user}', function (User $user) { return $user; }); 在 Laravel 5.1 中,你需要通过 Route::model 方法告诉 Laravel 注入 App\User 实例以匹 配路由定义中的 {user} 参数。 现在,在 Laravel 5.2 中,框架将会基于相应 URI 片段自动注入模型,从而允许你快速 中。 实际上,默认的 Laravel 5.2 应用结构采用的正是这个方法。例如,在默认 的 App\Http\Kernel.php 文件中你会看到如下内容: /** * The application's route middleware groups. * * @var array */ protected $middlewareGroups = [ 'web' lScope($scope) 这种方式来调用。 在 Eloquent 查询构建器中新增了 withoutGlobalScope 和 withoutGlobalScopes 方法,任 何调用 $model->removeGlobalScopes($builder) 的地方现在都要改 成 $builder->withoutGlobalScopes()。 事件 核心事件对象 Laravel0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 5.3 中文文档namespace App; use Laravel\Scout\Searchable; use Illuminate\Database\Eloquent\Model; class Post extends Model { use Searchable; } trait 被添加到模型之后,当保存模型实例的时候其信息将会被同步到搜索索引: $order Laravel 学院致力于提供优质 Laravel 中文学习资源 22 ]); 例如,如果你之前定义了如下$morphClass: class User extends Model { protected $morphClass = 'user' } 现在则需要在 AppServiceProvider 的 boot 方法中定义如下 morphMap: 之 路。 Laravel 源码通过 Github 进行管理,每一个 Laravel 项目都有其对应的代码库: Laravel Framework Laravel Application Laravel Documentation Laravel Cashier Laravel Cashier for Braintree Laravel0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.1 中文文档public static function find($id, $columns = ['*']){ $model = static::query()->find($id, $columns); // ... return $model; } lists 方法 lists 方法现在返回一个 Collection 实例而不是包含 Eloquent 修复问题之路。 Laravel 源码通过 Github 进行管理,每一个 Laravel 项目都有其对应的代码库: Laravel Framework Laravel Application 本文档由 Laravel 学院(LaravelAcademy.org)提供 8 Laravel Documentation Laravel Cashier 当然,如果你不需要传递一个自定义的 HTTP 状态码或者自定义头,只需要简单使用全局 的帮助函数 view 即可。 2.2 JSON 响应 json 方法会自动将 Content-Type 头设置为 application/json,并使用 PHP 函数 json_encode 方法将给定数组转化为 JSON: return response()->json(['name' => 'Abigail', 'state'0 码力 | 307 页 | 3.46 MB | 1 年前3
《Slides Dev Web》 01. Cours devweb
Il n’est pas interdit d’en ajouter Conseils • Le plus simple possible, pas trop de données • Application crédible (vraies données, cas réalistes) • Projet à blanc pour la prise en main du framework 4 toutes les étapes impor- tantes de Laravel ∗ route, validation des entrées, contrôleur, vue – Application déployée avec tous les éléments cités plus haut testable et fonctionnel Évaluation des projets eu/blog/difference-between-wireframe-mockup-prototype/ 18http://drewfradette.ca/a-simpler-successful-git-branching-model/ 5 Participation • Aux projets des autres : Issues, PR • Participez à la Hacktoberfest19 • Pariticipez0 码力 | 7 页 | 129.56 KB | 1 年前3
共 20 条
- 1
- 2













