Multi-auth Mutltitrust (Controller)
Requirement
You can find Entrust and other packages which is helpful for roles and permission . but that are not active multi-auth system. Now time for Multi-Auth
. Here Multitrust follow @jacurtis
multi-auth system . so at first follow how implement multi-auth .
- Multi-Auth
you can find multi-auth demo here Multi-Auth-demo
or follow video series Jacurtis multi-auth
Roles master
Attaching, Detaching and Syncing Roles (user+admin)
|
tips-1
use App\User;use Code4mk\Multitrust\Models\Role;public function update(Request $request, $id){$user = User::find($id);$roles = $request->roles;$user->update();$user->attachRole($roles);}Now same way
Admin
|
- tips-1
|
Permissions master
- Attaching, Detaching and Syncing Permissions (users, admins, roles)
users+permissions
|
- tips-1use App\User;use Code4mk\Multitrust\Models\Permission;public function update(Request $request, $id){$user = User::find($id);$permission = $request->permission;$user->update();$user->attachPermission($permission);}
admins+permissions
|
- tips-1use App\Admin;use Code4mk\Multitrust\Models\Permission;public function update(Request $request, $id){$admin = Admin::find($id);$permission = $request->permission;$admin->update();$admin->attachPermission($permission);}
roles+permissions
|
- tips-1
|
Powered by:
@code4mk