hi I wants that only admin can access the filecontroller route, or user can't access by typing URL:
these are routes:
Route::group(['middleware' => ['web','auth']], function(){
Route::get('/', function () {
return view('welcome');
});
Route::get('/home', function(){
if (Auth::user()->admin == 0) {
return view('home');
} else {
$users['users'] = \App\User::all();
return view('layouts.master', $users);
}
});
Route::resource('file','FileController');
});
User can't access Route::resource('file','FileController'); if he knows URL