CodeWithDennis
CodeWithDennis
FFilament
Created by CodeWithDennis on 2/18/2025 in #❓┊help
Clipboard contents after action has been clicked
it('can copy to clipboard', function (string $field) {
$record = Company::factory()->create();

$actionName = 'copy';

livewire(ViewCompany::class, ['record' => $record->getRouteKey()])
->assertSuccessful()
->assertFormComponentActionExists($field, $actionName)
->assertFormComponentActionHasIcon($field, $actionName, 'heroicon-s-clipboard')
->assertFormComponentActionHasColor($field, $actionName, 'gray')
->callFormComponentAction($field, $actionName)
->assertFormComponentActionHasIcon($field, $actionName, 'heroicon-s-clipboard-document-check')
->assertFormComponentActionHasColor($field, $actionName, 'success')
->assertDispatched('copy-to-clipboard');
})->with(['email', 'phone']);
it('can copy to clipboard', function (string $field) {
$record = Company::factory()->create();

$actionName = 'copy';

livewire(ViewCompany::class, ['record' => $record->getRouteKey()])
->assertSuccessful()
->assertFormComponentActionExists($field, $actionName)
->assertFormComponentActionHasIcon($field, $actionName, 'heroicon-s-clipboard')
->assertFormComponentActionHasColor($field, $actionName, 'gray')
->callFormComponentAction($field, $actionName)
->assertFormComponentActionHasIcon($field, $actionName, 'heroicon-s-clipboard-document-check')
->assertFormComponentActionHasColor($field, $actionName, 'success')
->assertDispatched('copy-to-clipboard');
})->with(['email', 'phone']);
12 replies
FFilament
Created by CodeWithDennis on 2/18/2025 in #❓┊help
Clipboard contents after action has been clicked
This will be a nice addition to it tho.
->assertDispatched('copy-to-clipboard')
->assertDispatched('copy-to-clipboard')
✓ it can copy to clipboard with ('email')
✓ it can copy to clipboard with ('phone')
✓ it can copy to clipboard with ('email')
✓ it can copy to clipboard with ('phone')
12 replies
FFilament
Created by CodeWithDennis on 2/18/2025 in #❓┊help
Clipboard contents after action has been clicked
Mmm, what i wanted to test is if the state was matching the clipboard, so have to execute some JS i think 🤔
12 replies
FFilament
Created by CodeWithDennis on 2/18/2025 in #❓┊help
Clipboard contents after action has been clicked
But im not sure if we can even access something like that in tests. 🤔
12 replies
FFilament
Created by CodeWithDennis on 2/18/2025 in #❓┊help
Clipboard contents after action has been clicked
After that is basically writes to the clipboard. navigator.clipboard.writeText(text);
12 replies
FFilament
Created by CodeWithDennis on 2/18/2025 in #❓┊help
Clipboard contents after action has been clicked
// Custom action btw
Action::make('copy')
->icon('heroicon-s-clipboard')
->color('gray')
->visible(fn ($state) => $this->getCopyable() && ! empty($state))
->action(function ($livewire, $state, Action $action) {
$action->icon('heroicon-s-clipboard-document-check')
->color('success');

$livewire->dispatch('copy-to-clipboard', text: $state);
}),
// Custom action btw
Action::make('copy')
->icon('heroicon-s-clipboard')
->color('gray')
->visible(fn ($state) => $this->getCopyable() && ! empty($state))
->action(function ($livewire, $state, Action $action) {
$action->icon('heroicon-s-clipboard-document-check')
->color('success');

$livewire->dispatch('copy-to-clipboard', text: $state);
}),
12 replies
FFilament
Created by CodeWithDennis on 2/18/2025 in #❓┊help
Clipboard contents after action has been clicked
Form component (TextInput).
12 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
I just didn't have time to work on it yet, but thanks for doing my job. 🤣
28 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
Probably!
28 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
Haven't fixed it yet 👀
28 replies
FFilament
Created by Nobody on 12/16/2024 in #❓┊help
Is It Possible to Use a Single Login URL for All Roles in Filament Shield?
Not related to this issue, but wanted to put it here since you guys are talking about it That tutorial was fantastic and really helpful! ✨ Suggestion: It would be great to see another follow-up tutorial that ensures the login page redirects to the correct panel when already logged in. Right now, it just goes to the default panel instead of the one set up in the responses. Feel free to me PM if you need more details 😉 @Povilas K
28 replies
FFilament
Created by Garadit on 10/31/2024 in #❓┊help
Lazy load table column
You don't need raw queries you can still do it with ORM but just needs to know how.
18 replies
FFilament
Created by Garadit on 10/31/2024 in #❓┊help
Lazy load table column
I think you should take a look at your getStatusAttribute logic.
18 replies
FFilament
Created by Garadit on 10/31/2024 in #❓┊help
Lazy load table column
Yes, but was just refering to your statement.
18 replies
FFilament
Created by Garadit on 10/31/2024 in #❓┊help
Lazy load table column
You should check debugbar and check how many queries are executed.
18 replies
FFilament
Created by Garadit on 10/31/2024 in #❓┊help
Lazy load table column
But looking at this code it might not be a great approach 😅
18 replies
FFilament
Created by Garadit on 10/31/2024 in #❓┊help
Lazy load table column
Thats not true, we have the concurrency helper. https://www.youtube.com/watch?v=PMEQ93kBc7U
18 replies
FFilament
Created by Garadit on 10/31/2024 in #❓┊help
Lazy load table column
Can you show me that column?
18 replies
FFilament
Created by jjo63 on 10/22/2024 in #❓┊help
Adding a record count alongside a navigation link
No.
10 replies