Grogu
Grogu
FFilament
Created by Grogu on 3/12/2025 in #❓┊help
Conditional actions on table columns
Hi all! I have a table, along the Y axis (rows) is a list of locations, and each column along the X axis is information from different relations to that Location (complianceA.name, complianceB.name). I want the ability when clicking on the column, to either open an edit modal for the relation if it exists, and to open a create modal for the relation if it does not exist. Any help appreciated!
16 replies
FFilament
Created by Grogu on 3/7/2025 in #❓┊help
New tailwindcss classes not bundling in new blade files
Wondering what I'm doing wrong. I have composer dev / npm run dev running, and created a new file: resources/views/livewire/application-nav.blade.php Added hover:text-blue-500 to an element in the new file, restarted the bundlers, but that class is never being generated in the bundled css file and therefore the text is not turning blue on hover. Any help appreciated!
27 replies
FFilament
Created by Grogu on 2/22/2025 in #❓┊help
Unique validation on 2 or more columns
In my model migration, I have a unique constraint between 2 columns:
$table->unique(['column_1', 'column_2'])
$table->unique(['column_1', 'column_2'])
How do I enforce this in my filament resource when creating or editing? Thanks!
1 replies
FFilament
Created by Grogu on 2/15/2025 in #❓┊help
Relation manager not allowing duplicates
Hi there, I have roles and users in my app. In the pivot table, there is an optional "assignable" morph, so that the role can be against another entity, such as my Location model... "A user has a role for this location..." I should be able to attach multiple roles to a user, as long as the assignable is different, so the user can have the same role for multiple locations, but I can't seem to figure out how to achieve this? In the relation manager attach action, the role is removed from the selection as soon as it's been assigned once. If I hard code the role options to always displace all, if i attach multiple roles to a user with different "assignables", when I "detach" one record, it detaches all relations which have the same user_id, role_id... Any help? I've attached some files, and my relationships include the id pivot:
// user model role relation
public function roles(): BelongsToMany
{
return $this->belongsToMany(Role::class)
->withPivot('id', 'assignable_type', 'assignable_id')
->withTimestamps();
}

// role model users relation
public function users(): BelongsToMany
{
return $this->belongsToMany(User::class)
->withPivot('id', 'assignable_type', 'assignable_id')
->withTimestamps();
}
// user model role relation
public function roles(): BelongsToMany
{
return $this->belongsToMany(Role::class)
->withPivot('id', 'assignable_type', 'assignable_id')
->withTimestamps();
}

// role model users relation
public function users(): BelongsToMany
{
return $this->belongsToMany(User::class)
->withPivot('id', 'assignable_type', 'assignable_id')
->withTimestamps();
}
Thanks!
2 replies
FFilament
Created by Grogu on 2/12/2025 in #❓┊help
How to set the default action on table row click
Hi all! It seems an obvious one, but I can't seem to figure out how filament determines the default action when a table row is clicked. I have 2 resources, both have View and Edit actions in the $table->actions() array, yet when clicking a row in 1 of the resources, I am taken to the edit page and the other resource goes to the view page? Thanks!
7 replies