Laravel

jetstream nuxt api

Hi everyOne !!

I want use laravel jetstream with inertia this the backend and use it for change themes and text for the pages this only for the admins can access

and also use nuxt in front end with api this is the frontend

so use Sanctum for api and Fortify for login and register for api - NUXT

I want use the dashboard of the jetstream for admin to change layouts

and the frontend nuxt also have dashboard but this only for users

the problem now I want only admin can use the jetstream dashboard !!

is that Possible user the features of the jetstream for admins or i need to make new controller and new guards and new login page

thank u

AhmadUUID Member
AhmadUUID
0
6
208
ms_dan
ms_dan

Yes it is possible, set up a role management, & a middleware for admin access.

AhmadUUID Member
AhmadUUID

what i did I created new table , model,controller for admins and also make new guards admin . and new login page and dashboard

and now only the people in the admin table can access in the jetstream dashboard and the people in the user table can access in the nuxt dashboard in the frontend

ms_dan
ms_dan

That works, however, a better practice would be to build up a role management system with middleware.

AhmadUUID Member
AhmadUUID

you mean add role in the users table and use it in middleware and than use the middleware in route

ms_dan
ms_dan

Yeah, it's a simple solution, rather than building things out again.

AhmadUUID Member
AhmadUUID

thank u. I will try it. I wish u a nice weekend