frame
frame
FFilament
Created by frame on 1/15/2025 in #❓┊help
Style tenant dropdown when user only has access to a single tenant
My dumb ass doesn't know how to publish it so use this css instead
/* Style tenant menu button if no dropdown */

.fi-sidebar-nav-tenant-menu-ctn .fi-dropdown-trigger:only-child button.fi-tenant-menu-trigger {
@apply bg-inherit cursor-auto;
}

.fi-sidebar-nav-tenant-menu-ctn .fi-dropdown-trigger:only-child svg[icon-alias="panels::tenant-menu.toggle-button"] {
@apply invisible;
}
/* Style tenant menu button if no dropdown */

.fi-sidebar-nav-tenant-menu-ctn .fi-dropdown-trigger:only-child button.fi-tenant-menu-trigger {
@apply bg-inherit cursor-auto;
}

.fi-sidebar-nav-tenant-menu-ctn .fi-dropdown-trigger:only-child svg[icon-alias="panels::tenant-menu.toggle-button"] {
@apply invisible;
}
9 replies
FFilament
Created by frame on 1/15/2025 in #❓┊help
Style tenant dropdown when user only has access to a single tenant
Thanks, you mean publishing tenant-menu.blade.php and editing it?
9 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Query string null in a relationmanager
Hey! Yeah i did something like that. Setting group as a property worked and also helped debug another problem I had, this time with custom pages 😅 https://discord.com/channels/883083792112300104/1327240818855252000/1327250122551201852
public Group $group;
public User $user;
public function mount(string $record): void
{
$groupUuid = request()->query('group');
$this->group = Group::where('uuid', $groupUuid)->firstOrFail();
$this->record = $this->resolveRecord($record);
$this->user = $this->record; // So user is always available in `$table->query`
}
public Group $group;
public User $user;
public function mount(string $record): void
{
$groupUuid = request()->query('group');
$this->group = Group::where('uuid', $groupUuid)->firstOrFail();
$this->record = $this->resolveRecord($record);
$this->user = $this->record; // So user is always available in `$table->query`
}
Using #[Url] to optimize line count further might be a good idea 👍
13 replies
FFilament
Created by frame on 1/14/2025 in #❓┊help
Overriding Filepond labels
Doesn't look like it's possible.
4 replies
FFilament
Created by frame on 1/14/2025 in #❓┊help
FileUpload file validation after upload, before submit
Thanks! 💖 I may have gotten it working with
->afterStateUpdated(function (\Livewire\Component $livewire, Forms\Components\FileUpload $component)
$livewire->validateOnly($component->getStatePath())
})
->afterStateUpdated(function (\Livewire\Component $livewire, Forms\Components\FileUpload $component)
$livewire->validateOnly($component->getStatePath())
})
5 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Custom resource page $this->record null when searching/sorting
Actually did not work I just messed up. What really worked is setting additional public MyModel $myRecord; in the page and setting that on mount and using that instead of $this->record
5 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Query string null in a relationmanager
belongstomany
13 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Custom resource page $this->record null when searching/sorting
resolveRecord needs to be defined, then it works 👍
public function mount(string $record): void
{
$this->record = $this->resolveRecord($record);
}

public function resolveRecord($record)
{
return Group::where('uuid', $record)->firstOrFail();
}
public function mount(string $record): void
{
$this->record = $this->resolveRecord($record);
}

public function resolveRecord($record)
{
return Group::where('uuid', $record)->firstOrFail();
}
5 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Query string null in a relationmanager
Filter relationmanager rows by two columns, User and Group. So $record would be User but then I need to also pass Group so I need to pass that by query string in URL, for example UserResource::getUrl('view', ['record' => $record, 'group_id' => $group->id])
13 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Query string null in a relationmanager
Better to create a custom resource page👍
13 replies
FFilament
Created by frame on 12/31/2024 in #❓┊help
Adding where clause to query using current session
Possibly working with $table->modifyQueryUsing(function (Builder $query) {}) 🤔
6 replies
FFilament
Created by frame on 12/30/2024 in #❓┊help
Searchable by pivot name
Had to define searchable(['pivot_table_name.name']) instead
4 replies
FFilament
Created by frame on 12/30/2024 in #❓┊help
TextEntry as link to related resource
Thanks! Got it with ->url(fn ($record) => ClientResource::getUrl('view', ['record' => $record->client_id]))
5 replies