pinpointzero
pinpointzero
FFilament
Created by pinpointzero on 10/14/2024 in #❓┊help
Multiple Filament tables on a Livewire component
Yes indeed, that seems to be the way! 🙂
6 replies
FFilament
Created by pinpointzero on 10/14/2024 in #❓┊help
Multiple Filament tables on a Livewire component
The issue I have is of my own making as I'm using Livewire components and not a Filament panel. 🙂
6 replies
FFilament
Created by pinpointzero on 10/14/2024 in #❓┊help
Multiple Filament tables on a Livewire component
Hi Leandro, I hope you're well, and thank you for this. It would be ideal in a specific component I'm building to be able to put two through the same component. If it is going to be awkward to set-up and maintain, this way seems more proper. Thank you. 🙂
6 replies
FFilament
Created by pinpointzero on 10/9/2024 in #❓┊help
Automatic Filament ViewAction on Livewire component
Tried a slightly different approach, and that's not working either.
Action::make(name: 'viewUser')
->form(form: UsersSchema::form())
->formData($this->userData)
->slideOver()
->call();
Action::make(name: 'viewUser')
->form(form: UsersSchema::form())
->formData($this->userData)
->slideOver()
->call();
6 replies
FFilament
Created by pinpointzero on 10/9/2024 in #❓┊help
Automatic Filament ViewAction on Livewire component
It's just a Livewire component for this one.
6 replies
FFilament
Created by pinpointzero on 10/9/2024 in #❓┊help
Automatic Filament ViewAction on Livewire component
public function mount(): void
{
// Fetch GET request parameters
$getParams = request()->query();
if (isset($getParams['id']) && is_numeric($getParams['id'])) {

Log::debug('ListUsers::mount() id: ' . $getParams['id']);
$this->userId = (int) $getParams['id'];
}
}
public function mount(): void
{
// Fetch GET request parameters
$getParams = request()->query();
if (isset($getParams['id']) && is_numeric($getParams['id'])) {

Log::debug('ListUsers::mount() id: ' . $getParams['id']);
$this->userId = (int) $getParams['id'];
}
}
Thank you for your response Zen. Yup, got that bit; but I can't get the view to automatically trigger to show it.
Action::make('show')
->formData($this->user->toArray())
->form(UsersSchema::form())
->label('View')
->icon('heroicon-s-eye')
->action(fn(User $record) => $this->showUser($record->id))
Action::make('show')
->formData($this->user->toArray())
->form(UsersSchema::form())
->label('View')
->icon('heroicon-s-eye')
->action(fn(User $record) => $this->showUser($record->id))
That's what the action looks like (minus the ->visible(false)
6 replies
FFilament
Created by Null Keso on 10/8/2024 in #❓┊help
When do you use multiple panels?
Hi Null, I have a specific project where I have six separate panels. One for a super-admin who can (literally) do anything, another for admin to manage users, and then the other four for separate user-types. You can have one panel, and make sure that all of the resources you present are tailored depending on the user who is logged in, but, I find the separation of panels a separation of concerns, and it's cleaner. Also, you can use Laravel's built-in Policy system to ensure that only certain users can access panels, and to reduce resource code footprint, you can use Laravel Macros.
4 replies
FFilament
Created by pinpointzero on 10/1/2024 in #❓┊help
ViewField Form error.
Oh goodness me. My sincere apologies @Leandro Ferreira. I've changed the ViewField to be just a View and it's all working now. Apologies.
6 replies
FFilament
Created by pinpointzero on 10/1/2024 in #❓┊help
ViewField Form error.
That's the view code as it stands, and, there are references. I've always assumed that a ViewField isn't accounted for when saving data in a form.
6 replies
FFilament
Created by pinpointzero on 10/1/2024 in #❓┊help
ViewField Form error.
Hi Leandro, Thanks so much for responding.
<div>
@if ($getRecord() && $getRecord()->users)
<div class="filament-tables-component">
@if ($getRecord()->users->count() > 0)
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 filament-table">
<thead class="bg-gray-50 dark:bg-gray-700">
...
</thead>
<tfoot></tfoot>
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
@foreach($getRecord()->users as $user)
<tr class="table-striped">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-200">
{{ $user->id }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
{{ $user->name }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
{{ $user->email }}
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div class="text-center">
There are no Users bound to {{ $getRecord()->name }} presently.
</div>
@endif
@endif
</div>
</div>
<div>
@if ($getRecord() && $getRecord()->users)
<div class="filament-tables-component">
@if ($getRecord()->users->count() > 0)
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 filament-table">
<thead class="bg-gray-50 dark:bg-gray-700">
...
</thead>
<tfoot></tfoot>
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
@foreach($getRecord()->users as $user)
<tr class="table-striped">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-200">
{{ $user->id }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
{{ $user->name }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
{{ $user->email }}
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div class="text-center">
There are no Users bound to {{ $getRecord()->name }} presently.
</div>
@endif
@endif
</div>
</div>
6 replies
FFilament
Created by pinpointzero on 6/12/2024 in #❓┊help
Filament table in Livewire component!
I've added the directive, but the modals are still empty. I feel I've missed out something silly.
6 replies
FFilament
Created by pinpointzero on 6/12/2024 in #❓┊help
Filament table in Livewire component!
Aah, I haven't. The modals are popping up, but they're empty. I don't know if I'm expected to populate them myself, but as Filament would normally do this via the return $form, I'm a little lost.
6 replies