-
建表
1php artisan make:migration create_users_table --create=users -
建立表的字段
1php artisan make:migration add_votes_to_users_table --table=users #给users表增加votes字段 -
建立模型
1php artisan make:model name -
模型与user的互相绑定
1写方法 hasmany belengsto...... -
建立代理类
12make:repositorymake:bindings -
在controler里面设置代理类
1234567public function (CourselistRepository $repository){$this->repository = $repository;$this->middleware('auth',['except'=>['index','show']]);# code...} -
index 显示 然后跳转到 create ceate里面会传递一些需要的东西
- creat 会跳转到 store
- 设置 request 设置验证用户的输入条件
1php artisan make:request
近期评论