Chomneau Men
Chomneau Men

Reputation: 51

How to allow two authentication access to one route in laravel?

I have one route with protect by admin authentication(midleware). but I want employer auth can access this route too. how can I do that in contructor.

    public function __construct()
    {
            $this->middleware('auth:admin');
           // $this->middleware('auth:employer');
    }

Upvotes: 0

Views: 34

Answers (1)

Mahdi Younesi
Mahdi Younesi

Reputation: 7489

Seprate by |

 $this->middleware('auth:admin|employer');

Upvotes: 2

Related Questions