 3ec90264bd
			
		
	
	
		3ec90264bd
		
			
		
	
	
	
	
		
			
			* remove `guard_name` from api and add id to transformer * disallow update/ delete for root admin role via api * disallow assigning root admin via api * add api to remove user roles * fix assignRoles & removeRoles
		
			
				
	
	
		
			23 lines
		
	
	
		
			503 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			503 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Transformers\Api\Application;
 | |
| 
 | |
| use Spatie\Permission\Models\Permission;
 | |
| 
 | |
| class RolePermissionTransformer extends BaseTransformer
 | |
| {
 | |
|     public function getResourceName(): string
 | |
|     {
 | |
|         return 'permissions';
 | |
|     }
 | |
| 
 | |
|     public function transform(Permission $model): array
 | |
|     {
 | |
|         return [
 | |
|             'name' => $model->name,
 | |
|             'created_at' => $model->created_at->toAtomString(),
 | |
|             'updated_at' => $model->updated_at->toAtomString(),
 | |
|         ];
 | |
|     }
 | |
| }
 |