lundi 24 mai 2021

how to redirect logged in user to specific view on some conditions?

i already read this answer laravel 5 redirect user after login based on user's role

but it is not helpful for me consider role 3 user is loged in already and he is woking in application

i want that on his every acation this function should run and check his status

if his admin change his status to 1 then on his(role 3 user) every action on click to any button he must be(role 3 user) redirected to given url

    public function check(){
     
     if(Auth::user()->role == 3)
        
        {
        $seller =  Seller::where('id' , Auth::id())->pluck('status')->first(); 
        if ($seller == 1){
        return redirect()->route('unconfirmed.orders')->with('error', 'please verify order first');
        } 
    }
}

i want to know in which file i have work in



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2QJnvBO
via IFTTT

Aucun commentaire:

Enregistrer un commentaire