I want to use my show method in controller between if statement while declaring route:
Route::get('/leave', function() {
if(Auth::user()->admin)
{
'uses' => 'TimeController@show'
}
else {
return "not found";
}
})->name('admin-time');
but the uses
that I define it doesn't work! and I know it shouldn't works.