多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
laravel的四种路由方式: ![](https://box.kancloud.cn/3b32cd2bda4e237a3272f09364604057_1266x629.png) 多数我们使用第一种方式,Http方法: ~~~ // Route::get('/', '[控制器]@[行为]'); Route::put('/posts', '\App\Http\Controllers\PostController@index'); ~~~ 刚下载的laravel的预设路由: ~~~ Route::get('/', function () { return view('welcome'); }); ~~~ 路由分组: ~~~ Route::group(['prefix' => 'posts'], function(){ Route::put('/', '\App\Http\Controllers\PostController@index'); Route::put('/crate', '\App\Http\Controllers\PostController@index'); }); // 等效 Route::put('/posts', '\App\Http\Controllers\PostController@index'); Route::put('/posts/crate', '\App\Http\Controllers\PostController@index'); ~~~