knous
knous
FFilament
Created by knous on 11/12/2024 in #❓┊help
Displaying data from BelongsToMany relationship in UserRelationManager
I'm having trouble displaying the Role title in a UserRelationManager table column. Here’s the setup I currently have: Model: Account.php public function users() { return $this->belongsToMany(User::class, 'user_accounts', 'account_d', 'user_id', 'id', 'id') ->withPivot('id', 'role_id', 'email') ->withTimestamps(); } Model: User.php public function accounts() { return $this->belongsToMany(Account::class, 'user_accounts', 'user_uuid', 'account_uuid', 'uuid', 'uuid') ->withPivot('id', 'role_id', 'email') ->withTimestamps(); } Model: UserAccount.php (Pivot Model) public function user() { return $this->belongsTo(User::class, 'user_id', 'id'); } public function account() { return $this->belongsTo(Account::class, 'account_id', 'id'); } public function role() { return $this->belongsTo(Role::class, 'role_id', 'id'); } Displaying Columns in UserRelationManager I’m trying to display both role_id and role.title in the table columns like this: Tables\Columns\TextColumn::make('role_id') ->label('Role ID') ->sortable(), Tables\Columns\TextColumn::make('role.title') ->label('Role Title') ->searchable() ->sortable(), However, only the role_id displays correctly. role.title doesn’t show up as expected. Does anyone know why role.title isn’t displaying in the column, or how I might fix this? Any help would be appreciated! Thanks!
2 replies
FFilament
Created by knous on 10/19/2023 in #❓┊help
how to fill data with RelationManager Associate
No description
2 replies
FFilament
Created by knous on 9/6/2023 in #❓┊help
get dependant country, state and city
Can anyone suggest me a good package to get country, state and city with filament or in laravel . Thanks in advance.
5 replies
FFilament
Created by knous on 5/15/2023 in #❓┊help
How use repeater to save an input in the pivot table
4 replies
FFilament
Created by knous on 5/8/2023 in #❓┊help
disabledOn using user role
how disable a field in edit depending on user role ?
6 replies