samedi 28 juillet 2018

how to configure Laratrust user controller system diffrent menus to diffrent users

In My Laravel 5.6 app I am using "Laratrust" User Controller system to manage My users. I am using laravel auth command to create my normal user registration and login system. in my system i have 3 different users 1.super administrator 2.administrator 3.normal user

but when I use these 3 different users to logging with the system. all users (super administrator,administrator and user) are redirect to same home.blade.php file like url http://localhost:8000/home but I need diffrent home pages to different users like,

1.http://localhost:8000/home  for user
2.http://localhost:8000/superadmin/home for superadministrator
3.http://localhost:8000/administrator/home for administrator

My HomeController

class HomeController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return view('home');
    }
}

My users table structure is

id name                  email
1  superadministrator    sd@mail.com
2  administrator         as@mail.com
3  alex                  alex@mail.com

how can develop this?



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

Aucun commentaire:

Enregistrer un commentaire