Home > Blockchain >  Is it correct to use if else condition in laravel routes
Is it correct to use if else condition in laravel routes

Time:11-21


Route::get('/', function (){
    if(Auth::check()){
        return view('home');
    }
    else{
        return view('auth/login');
    }

or it is better with middleware to check if user is Auth

CodePudding user response:

middleware use to best solution

  • Related