<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/

Route::get('/','GuestController@index');
Route::group(['prefix'=>'admin','middleware'=>['auth','role:admin']],function(){
Route::resource('toko','TokoController');
Route::resource('menu','MenuController');
Route::resource('members','MembersController');
Route::get('statistics', [
'as'=>'statistics.index',
'uses'=>'StatisticsController@index'
]);

});
Route::get('menu/{menu}/beli',[
  'middleware' =>['auth','role:member'],
  'as'         =>'guest.menu.beli',
  'uses'       =>'MenuController@beli'
]);
Route::put('menu/{menu}/batal', [
  'middleware' => ['auth', 'role:member'],
  'as' => 'member.menu.batal',
  'uses' => 'MenuController@diBatalkan'
]);
Route::get('settings/profile', 'SettingsController@profile');
Route::get('auth/verify/{token}', 'Auth\RegisterController@verify');
Route::get('auth/send-verification', 'Auth\RegisterController@sendVerification');
Route::get('settings/profile/edit', 'SettingsController@editProfile');
Route::post('settings/profile', 'SettingsController@updateProfile');
Route::get('settings/password', 'SettingsController@editPassword');
Route::post('settings/password', 'SettingsController@updatePassword');
Auth::routes();
Route::get('/home', 'HomeController@index');
