路由和路由的辅助方法

 

 

1. 

  redirect()

  route()

  ->name()

    Route::get('/', function () {
        return redirect('/blog');
    });


    Route::get('/blog', 'BlogController@index')->name('blog.home');
    Route::get('/blog/{slug}', 'BlogController@showPost')->name('blog.detail');

 

2. 

 

posted @ 2019-06-27 20:09  aocn  阅读(93)  评论(0)    收藏  举报