Multi Auth and admin auth in Laravel Project
You can change any model from config file
Updated for Laravel 8 Added Laravel Legacy Factory Added Laravel UI version 3
If you need to have some route behind verified middleware, then you can use {guard}.verified
for example, if you have created a student guard then to protect student home page with email verified route you can add middleware like this inside routes/student.php file
...
Route::get('/', 'HomeController@index')->name('student.dashboard')->middleware('student.verified');
...
php artisan multiauth:install
command automatically run php artisan ui bootstrap
and then execute npm run install && npm run dev
This is the major release, do not update with the old version as this release has many breaking changes. Activation route changed
Removed admin policy and added a dynamic gate to AuthServiceProvider
Moved model to the configuration file
Permission table added
Permission commands added
while seeding super admin, permission is added to the role
All permission related function is inside hasPermission trait
All factories moved to database/factories
Post method to GET method for admin.all, admin.role and admin.me routes
All permissions with admin details for every admin
BigIncrement and unsignedBigInteger for the schema of admin, admin_role and role table
Install command - include publishing migration, publishing factories, running all migration and seeding initial super admin with role and permissions.
Role permissions are added to role resource (for jwt-auth version)
While creating a role, permissions also stored
adminFormRequest is now having role_ids instead of role_id
while store or update admin, directPermissions can also be synced
All permissions are group by parent
Added permitTo and permitToParent blade syntax and middleware
Add Multiple role to middleware separated by semicolon (:)
Activation route changed
Removed admin policy and added a dynamic gate to AuthServiceProvider
Moved model to the configuration
file
Permission
table added
Permission
commands added
while seeding super admin, permission is added to the role
All permission related function is inside hasPermission
trait
All factories moved to database/factories
Post
method to GET
method for admin.all, admin.role and admin.me routes
All permissions with admin details for every admin
BigIncrement
and unsignedBigInteger
for the schema of admin, admin_role and role table
Install
command - include publishing migration, publishing factories, running all migration and seeding initial super admin with role and permissions.
Role permissions
are added to role resource (for jwt-auth version)
While creating a role, permissions also stored
adminFormRequest
is now having role_ids instead of role_id
while store
or update
admin, directPermissions can also be synced
All permissions are group by parent
Added permitTo
and permitToParent
blade syntax and middleware
Add Multiple role to middleware separated by semicolon (:)
With laravel 6 str helper functions are deprecated, so this release now uses use Illuminate\Support\Str