After following, you can keep track of his dynamic information in a timely manner
Courses in the relevant section:Install laravel framework
镜像 composer config -g repo.packagist composer https://packagist.phpcomposer.com
2019-07-040个赞
Courses in the relevant section:laravel configuration and routing-1
创建控制器 php artisan make:controller IndexController
数据库配置文件 .env
路由 routes/web.php Route::get('/user',"IndexController@index") 新建页面 resource/view 数据模型 app/User.php 控制器 app/Http/Controllers
2019-07-040个赞
Courses in the relevant section:laravel configuration and routing-2
1、环境配置 .env文件 2、系统配置 config文件夹
生成密匙 php artisan key:generate
获取环境配置的方法 env('参数名') 如 env('APP_DEBUG')
网站下线(上线) php artisan down(up) 默认展示页面在 resources\views\errors\503.blade.php
查看路由列表 php artisan route:list
获取系统配置的方法 Config('app.timezone') 打印用dd() 修改方法 Config(['app.timezone'=>'PRC']) UTC -> PRC(中国)
基本路由:Route::get('index/index',"IndexController@index");
2019-07-091个赞
Courses in the relevant section:Laravel website construction-1
csrf 跨站请求伪造 {{csrf_field()}}
put请求:<input type="hidden" name="_method" value="put"> put接收 (Request $request) $request->input()
一个路由响应多个请求 Route::match(['get', 'post'], '/', function () {// }); Route::any('foo', function () { // });
资源路由:Route::resuorce('Admin','IndexCOntroller');
路由必选参数 Route::get('user/{id}', function ($id) { return 'User '.$id; }); 路由可选参数 Route::get('user/{name?}', function ($name = 'John') { return $name; });
命名路由 Route::get('user/profile', 'UserController@showProfile')->name('profile') 为命名路由生成URL return redirect()->route('profile'); 如果命名路由定义了参数,可以将该参数作为第二个参数传递给 route 函数 route('profile', ['id' => 1])
命名空间 Route::group(['namespace' => 'Admin'], function(){ // 控制器在"App\Http\Controllers\Admin" 命名空间下 });
2019-07-100个赞
Courses in the relevant section:Laravel website construction-2
进度
2019-07-110个赞