You could use Auth facade in your controller or view to choose which view to use/extend.
For examle, in controller:
public function show($id)
{
// ...
if ( \Auth::user()->isAdmin() )
return view('articles.adminshow');
} else {
return view('articles.show');
}
}
You'll also need to implement isAdmin()
method in your App/User
class.
In a view this would look like this:
@if ( \Auth::user()->isAdmin() )
@extends('admin-app')
@else
@extends('app')
@endif
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community