Pekempy
Pekempy
FFilament
Created by Pekempy on 7/6/2024 in #❓┊help
Collapse table groups by default
Seen a few threads about this without answer, also found this message: https://discord.com/channels/883083792112300104/1109929502223642685/1110180578898227210
we have already implemented this ready for v3
specifically in a thread about table grouping. I'm in v3 but can't seem to find any documentation or function to collapse table groups by default? Is there a workaround to this at all? Or is there a way to collapse all groups?
3 replies
FFilament
Created by Pekempy on 6/29/2024 in #❓┊help
Table rows Action->action() not firing
I have the below snippet (along with a few other actions) and I had initially been trying with \Log::info('test');, but it wasn't being fired so I thought I'd try dd() and it seems that the ->action part is never being reached at all. I tried duplicating another custom Action class class FollowShowAction extends Action {...} and just changing the ->action() to trigger a Notification, but it's still not firing, however the original custom Action I cloned from class BlockUserAction extens Action {...} works perfectly fine I've also shared the custom class action I created below. If I \Log::info('anything'); in the setUp() function, it logs correctly, and if I use ->url() instead of ->action() it works too. I just can't work out why it works for the action I duplicated from, but not this one The attached video is of the snippet immediately below:
->actions([
ActionGroup::make([
Action::make('follow')
->icon('heroicon-o-bell-alert')
->action(fn () => dd()),
]),
// ...
// ...
])
->actions([
ActionGroup::make([
Action::make('follow')
->icon('heroicon-o-bell-alert')
->action(fn () => dd()),
]),
// ...
// ...
])
Custom class action (also not working)
<?php

namespace App\Filament\Actions;

use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Illuminate\Database\Eloquent\Model;

class FollowShowAction extends Action
{
public static function getDefaultName(): ?string
{
return 'follow-show';
}

protected function setUp(): void
{
parent::setUp();

$this->label('Follow Show')
->icon('heroicon-o-bell-alert')
->action(function (Model $record) {
Notification::make()
->title('Show followed')
->success()
->send();
});
}
}
<?php

namespace App\Filament\Actions;

use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Illuminate\Database\Eloquent\Model;

class FollowShowAction extends Action
{
public static function getDefaultName(): ?string
{
return 'follow-show';
}

protected function setUp(): void
{
parent::setUp();

$this->label('Follow Show')
->icon('heroicon-o-bell-alert')
->action(function (Model $record) {
Notification::make()
->title('Show followed')
->success()
->send();
});
}
}
6 replies
FFilament
Created by Pekempy on 6/24/2024 in #❓┊help
Table Pagination - Jump to page
No description
3 replies
FFilament
Created by Pekempy on 6/15/2024 in #❓┊help
Overriding the Notification Panel
No description
6 replies
FFilament
Created by Pekempy on 6/1/2024 in #❓┊help
Minor - Switch `sortable()` default behaviour on tables?
Is there a way to switch the default way that sortable() works on a table, when first clicking it seems to do Asc, then the second click does desc. Can that be swapped to be desc first?
3 replies
FFilament
Created by Pekempy on 5/9/2024 in #❓┊help
Prevent pagination page numbers overflowing
No description
5 replies
FFilament
Created by Pekempy on 5/8/2024 in #❓┊help
BulkActions - Copy multiple rows to clipboard
I've got a custom Action that extends BulkAction, and I'm using $this->dispatch to send the data for the clipboard to the client: (this is in the ->action())
foreach ($records as $record) {
//copy to clipboard logic
$showName = $record->show->name;
$tourName = $record->production->name;
$date = $record->clipboardDate;
$this->clipboard .= "$showName - $tourName - $date\n";
}
$this->dispatch('copy-to-clipboard', [$this->clipboard]);
foreach ($records as $record) {
//copy to clipboard logic
$showName = $record->show->name;
$tourName = $record->production->name;
$date = $record->clipboardDate;
$this->clipboard .= "$showName - $tourName - $date\n";
}
$this->dispatch('copy-to-clipboard', [$this->clipboard]);
This works fine - ish. It only uses the data from the previous time you ran bulk action, rather than waiting for the foreach to finish it seems the dispatch is running first, even though it should be synchronous? The js in my blade file is:
<div x-data="{
copyToClipboard(event) {
console.log(event.detail);
navigator.clipboard.writeText(event.detail);
}
}"
x-on:copy-to-clipboard.window="copyToClipboard">
</div>
<div x-data="{
copyToClipboard(event) {
console.log(event.detail);
navigator.clipboard.writeText(event.detail);
}
}"
x-on:copy-to-clipboard.window="copyToClipboard">
</div>
Any ideas why this dispatch is running before the foreach loop ends, or how I can achieve this another way?
34 replies
FFilament
Created by Pekempy on 5/6/2024 in #❓┊help
(Beginner question) Repeater - Formatting the output after update
No description
14 replies
FFilament
Created by Pekempy on 4/19/2024 in #❓┊help
Routes not showing in Navigation
Hey - Beginner issue here. Having a problem with auth routes/navigation not filling out. When I run locally, I can see all the routes in the navigation bar and navigate the site fine, but when deployed it's 403 errors. After I deploy it (to Hetzner, using sail and mysql in docker), I'm unable to see almost all routes. It works to log in, so I know database connection is fine, but after logging in I don't see the same routes. I'm unsure how to debug this, the Laravel log doesn't seem to have anything identifiable, and as mentioned I can log in so I know the database connection is fine, just seems that the Resources aren't loading the navigation items? Anyone have any tips on what I can do to work out my issue it'd be appreciated
4 replies