Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- |--------------------------------------------------------------------------
- | Web Routes
- |--------------------------------------------------------------------------
- |
- | Here is where you can register web routes for your application. These
- | routes are loaded by the RouteServiceProvider within a group which
- | contains the "web" middleware group. Now create something great!
- |
- */
- // Route::get('/', function () {
- // return view('welcome');
- // });
- Route::get('/', 'PageController@index');
- Route::get('/about', 'PageController@about');
- Route::get('/services', 'PageController@services');
- Auth::routes();
- Route::get('/home', 'HomeController@index')->name('home');
- Route::group(['middleware' => 'auth'], function() {
- Route::get('/posts', 'PostController@index');
- Route::post('/comments', 'CommentController@store');
- Route::get('/posts/{id}', 'PostController@show');
- Route::get('/comments/{id}','CommentController@show');
- });
- Route::group(['middleware'=>['auth', 'isAdmin']],function() {
- Route::get('/posts/create', 'PostController@create');
- Route::post('/posts', 'PostController@store');
- Route::get('/posts/{id}/edit', 'PostController@edit');
- Route::put('/posts/{id}', 'PostController@update');
- Route::delete('/posts/{id}', 'PostController@destroy');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement