<?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!
|
*/
use App\database\migrations\bmw;

//Route for normal user
Route::group(['middleware' => ['auth']], function () {
    Route::get('/index', 'HomeController@index');
    Route::get('bmw', 'BikeController@BMW')->name('index');
    Route::get('/ducati', 'BikeController@DUCATI')->name('index1');
    Route::get('/yamaha', 'BikeController@YAMAHA')->name('index2');
    Route::get('/kawasaki', 'BikeController@KAWASAKI');
    Route::get('/suzuki', 'BikeController@SUZUKI');
    Route::get('/honda', 'BikeController@HONDA')->name('index3');
    Route::get('/home', 'UsersController@index');

});
//Route for admin
Route::group(['prefix' => 'admin'], function(){
    Route::group(['middleware' => ['admin']], function(){
        Route::get('/dashboard', 'admin\AdminController@index')->name('admin.index');
        Route::get('admin/dashboard/edit{id}', 'admin\AdminController@edit');
        Route::get('admin/dashboard/{id}', 'admin\AdminController@destroy');
        Route::post('dashboard/edit/{id}', 'admin\AdminController@update');
    });
});

//Route index
Route::get('/', 'UsersController@index');
Route::get('/', 'UsersController@indexa');
Route::resource('user', 'UsersController');
Auth::routes();
Route::get('/index', 'HomeController@index5');


// #PostController
Route::get('/post/create', 'PostController@create')->name('post.create');
Route::post('/post/store', 'PostController@store')->name('post.store');
Route::get('/posts', 'PostController@postindex')->name('postindexs');
Route::get('/post/show/{id}', 'PostController@show')->name('post.show');
Route::get('/post/delete/{id}', 'PostController@destroy')->name('post.destroy');
Route::get('/post/edit/{id}', 'PostController@edit')->name('post.edit');
Route::post('/post/update/{id}', 'PostController@update')->name('post.update');

// CommentController
Route::post('/comment/store', 'CommentController@store')->name('comment.add');
Route::post('/reply/store', 'CommentController@replyStore')->name('reply.add');
Route::get('/comment/delete/{id}', 'CommentController@destroy')->name('comment.destroy');
