rmove extra role columns

This commit is contained in:
2025-05-07 13:41:10 +03:30
parent ee943dd76f
commit d9ee1ca351
4 changed files with 3 additions and 5 deletions

View File

@@ -28,11 +28,10 @@ class UserManagementController extends Controller
$allowedSortings = $columns;
$allowedRelations = array('roles');
$allowedRelations = array('roles:id,name_fa');
$query = User::query()->where('username', "<>", "witel");
$data = DataTableFacade::run(
$query,
$request,

View File

@@ -14,6 +14,5 @@ class ProvinceController extends Controller
public function list(): JsonResponse
{
return $this->successResponse(Province::all('id', 'name'));
}
}

View File

@@ -25,7 +25,7 @@ class UserResource extends JsonResource
'position' => $this->position,
'province_id' => $this->province_id,
'province_name' => $this->province_name,
'role' => $this->getRoleNames()->first(),
'role' => $this->roles->pluck('id', 'name_fa'),
'telephone_id' => $this->telephone_id
];
}

View File

@@ -15,7 +15,7 @@ class User extends Authenticatable
protected $guarded = [];
protected $hidden = ['password'];
protected $hidden = ['password', 'pivot'];
public string $guard_name = 'web';
public function storeFile($file, $name)