Positiverain
Positiverain
FFilament
Created by Positiverain on 3/26/2024 in #❓┊help
Advanced toggle column to a table
That didn't help. Only thing that's close enough was "updateStateUsing()" method, but I am unable to change the state afterwards. The state stays 'null'.
4 replies
FFilament
Created by lazydog on 1/30/2024 in #❓┊help
CheckboxList SelectAll by default
When submitting form, you'll notice that the checkboxlist will return something for $data['checkboxlistinput'], the checked items of that checkbox. By reversing this process you are pre-filling the checkboxlist component. Have to use either of those two methods above.
5 replies
FFilament
Created by Dev_ on 1/30/2024 in #❓┊help
How can I achieve the automatic logout by the set time. Is it possible in Filament?
7 replies
FFilament
Created by lazydog on 1/30/2024 in #❓┊help
CheckboxList SelectAll by default
EditAction::make()
->mutateFormDataUsing(function (array $data): array {
$data['checkbox_list_items'] = Model::all()->pluck('id');

return $data;
})
EditAction::make()
->mutateFormDataUsing(function (array $data): array {
$data['checkbox_list_items'] = Model::all()->pluck('id');

return $data;
})
I personally used
ViewAction::make()
->form([...])
->fillForm(function ($record) {
return [
'checkbox_column' => $record->checkedItems()->pluck()
];
})
ViewAction::make()
->form([...])
->fillForm(function ($record) {
return [
'checkbox_column' => $record->checkedItems()->pluck()
];
})
5 replies
FFilament
Created by Dev_ on 1/30/2024 in #❓┊help
How can I achieve the automatic logout by the set time. Is it possible in Filament?
Use Laravel sessions, the default timeout for automatic logout is 120 minutes. It can be changed from ./config/session.php, under lifetime.
7 replies
FFilament
Created by kenromdavids on 6/5/2023 in #❓┊help
Ldaprecord with filament
in providers -> ldap -> model, don't forget to use
'providers' => [
'ldap' => [
'model' => LdapRecord\Models\OpenLDAP\User::class,
.......
'providers' => [
'ldap' => [
'model' => LdapRecord\Models\OpenLDAP\User::class,
.......
when using Online LDAP test server or any other OpenLDAP. source: https://www.youtube.com/watch?v=5lRBGdLrxj0
23 replies
FFilament
Created by ebermor on 10/4/2023 in #❓┊help
repeater
Forms\Components\Repeater::make('repeater')
->schema([
Forms\Components\Select::make('test')
->afterStateUpdated(function ($set, $state) {

})
])
Forms\Components\Repeater::make('repeater')
->schema([
Forms\Components\Select::make('test')
->afterStateUpdated(function ($set, $state) {

})
])
How do I use the afterStateUpdated to change the ->defaultItems() of the repeater in this situation?
14 replies
FFilament
Created by ebermor on 10/4/2023 in #❓┊help
repeater
I have the same question, so adding this: Is it possible to add more items by selecting an item from a select input? for example item1 of the repeater is a select, by selecting a value it adds another item, item2 to the repeater, which has the same select input. Am gonna use it for a model that has a parent and some children of same model type, self referencing models.
14 replies
FFilament
Created by Positiverain on 10/2/2023 in #❓┊help
How to add a custom 'CreateRecord Page' to the sidebar navigation?
Thanks
5 replies
FFilament
Created by Positiverain on 10/2/2023 in #❓┊help
How to add a custom 'CreateRecord Page' to the sidebar navigation?
When I use navigationItems() as in
$panel->navigationItems([
NavigationItem::make("navItem")
->url(TicketResource::getUrl('issue'))
])
$panel->navigationItems([
NavigationItem::make("navItem")
->url(TicketResource::getUrl('issue'))
])
I get Call to a member function getId() on null Error. same NavigationItem used in $panel->navigation(NavigationBuilder $builder) works as intended
5 replies
FFilament
Created by Positiverain on 6/17/2023 in #❓┊help
Eloquent Builder with relationships
Nvm I used parent::getEloquentQuery()->whereHas('roles', function($q) { return $q after where} and it fixed the problem
8 replies
FFilament
Created by Positiverain on 6/17/2023 in #❓┊help
Eloquent Builder with relationships
yeh it does work with finding only admins, but what if i want multiple roles? return User::role('admin'); works, but i also want to show the users along with admin return User::role(['admin','user']); doesn't work
8 replies
FFilament
Created by Positiverain on 6/17/2023 in #❓┊help
Eloquent Builder with relationships
yeh it is a users table, which is some how linked to roles table.. I am talking about this function from the user resource public static function getEloquentQuery(): Builder {....} which builds the table, Usually there is return parent::getEloquentQuery(); But I want only admins to be shown on the table
8 replies
FFilament
Created by Positiverain on 6/17/2023 in #❓┊help
How to use two forms for two models in one resource? Is it even possible?
damn i didn't see it, thanks for pointing out 😄
4 replies