MohamedSabil83
MohamedSabil83
FFilament
Created by dynamite on 4/21/2024 in #❓┊help
Error with 'multiple' Attribute in Select Input Field
belongsToMany relation or normal field casted as array
14 replies
FFilament
Created by dynamite on 4/21/2024 in #❓┊help
Error with 'multiple' Attribute in Select Input Field
You can't use ->multiple() with belongsTo relation
14 replies
FFilament
Created by Mike on 4/19/2024 in #❓┊help
Custom view OTP input not working(no js execution)?
@push not working with late rendering. You need to keep the code without @push or save it in a JS file and load it. You can take a look how plugins works to know how to achieve that. Also, try #hasan-ahani-otp-input if it applicable for you.
3 replies
FFilament
Created by Mehmet K. on 4/18/2024 in #❓┊help
How do I catch the notification for Notification in comments?
@Mehmet K. I'm not using that package before, but I guess you can use an observer for the comment model. On the created method on that observer, you can add the code of database notification.
3 replies
FFilament
Created by xechino on 4/18/2024 in #❓┊help
Is it possible to disable the entire sidebar based on a user?
If you mean hide the sections links, then you can achieve that in different ways: - Override the shouldRegisterNavigation() method in resources. - Override canAccess() method in custom pages. - Model policy.
4 replies
FFilament
Created by bahamagician on 4/18/2024 in #❓┊help
Set State of Select Field After Dynamically Populating Via Dependent Field
Because you use ->key('service_call_select'), I guess you need to use that key instead of $set('service_call_id', array_key_first($options));
20 replies
FFilament
Created by bahamagician on 4/18/2024 in #❓┊help
Set State of Select Field After Dynamically Populating Via Dependent Field
You can do similar to the following:
Forms\Components\Select::make('service_call_id')
->options(function (Get $get) {
$serviceCalls = ServiceCall::query()
->whereRelation('workOrder.customer', 'id', $get('customer_id'))
->orderBy('id', 'desc')
->pluck('id', 'id');
return $serviceCalls;
})
->afterStateHydrated(function ($state, Forms\Components\Select $component, Forms\Set $set) {
if (filled($state)) {
return;
}
$set('service_call_id', array_key_first($component->getOptions()));
})
->live()
->required(),
Forms\Components\Select::make('service_call_id')
->options(function (Get $get) {
$serviceCalls = ServiceCall::query()
->whereRelation('workOrder.customer', 'id', $get('customer_id'))
->orderBy('id', 'desc')
->pluck('id', 'id');
return $serviceCalls;
})
->afterStateHydrated(function ($state, Forms\Components\Select $component, Forms\Set $set) {
if (filled($state)) {
return;
}
$set('service_call_id', array_key_first($component->getOptions()));
})
->live()
->required(),
20 replies
FFilament
Created by Fahd on 4/18/2024 in #❓┊help
How to apply middleware to a custom page?
It became $routeMiddleware in V3
5 replies
FFilament
Created by Damien on 4/17/2024 in #❓┊help
Is there a way to prevent soft deleted records appearing in global search?
You're welcome
10 replies
FFilament
Created by Jon Mason on 4/18/2024 in #❓┊help
any way to customize validationMessages for a checkbox?
Usually label is simple, e.g. Name, and for that the message will be Name is required. A customize label like your code need a custom validation message to prevent take that from label
19 replies
FFilament
Created by Jon Mason on 4/18/2024 in #❓┊help
any way to customize validationMessages for a checkbox?
Also, for checkbox, when use accepted validation, no needs to use required
19 replies
FFilament
Created by Jon Mason on 4/18/2024 in #❓┊help
any way to customize validationMessages for a checkbox?
Tried your code and works as expected for accepted. For required, the browser itself display a tooltip to check
19 replies
FFilament
Created by aidzis on 4/18/2024 in #❓┊help
Section with reactive fields forces collapse after field value changes.
try to add the code to ->heading()
7 replies
FFilament
Created by Damien on 4/17/2024 in #❓┊help
Is there a way to prevent soft deleted records appearing in global search?
Hi! First, ensure that you are import the SoftDeletes trait in your model. If do and still soft-deleted records returned in the global search some how, then try to do the following as your code force it to display the soft delete records:
public static function getGlobalSearchEloquentQuery(): Builder
{
return parent::getGlobalSearchEloquentQuery()->whereNull('deleted_at');
}
public static function getGlobalSearchEloquentQuery(): Builder
{
return parent::getGlobalSearchEloquentQuery()->whereNull('deleted_at');
}
10 replies
FFilament
Created by Sawal on 4/17/2024 in #❓┊help
how to not show return option when condition not fullfill
You're welcome
7 replies
FFilament
Created by Sawal on 4/17/2024 in #❓┊help
how to not show return option when condition not fullfill
Using options(): ->options(fn () => Student::where('nim', 'not like', 'D121%'))->pluck('nim', 'id') Using relation(): -relation('student', 'nim', fn ($query) => $query->where('nim', 'not like', 'D121%'))
7 replies
FFilament
Created by Soundmit on 4/17/2024 in #❓┊help
Invite user and wrong credential
Right click on the message that provide the solution, from menu go to App, and from side menu click Mark Solution
11 replies
FFilament
Created by Soundmit on 4/17/2024 in #❓┊help
Invite user and wrong credential
Typo, now() not 'now()'
11 replies
FFilament
Created by Soundmit on 4/17/2024 in #❓┊help
Invite user and wrong credential
@Soundmit don't forget to set Mark Solution
11 replies
FFilament
Created by Damien on 4/17/2024 in #❓┊help
Is there a way to prevent soft deleted records appearing in global search?
You're welcome
10 replies