ngoquocdat
ngoquocdat
FFilament
Created by ngoquocdat on 10/21/2023 in #❓┊help
Custom property in CreateRecord form
anyone squint
2 replies
FFilament
Created by ngoquocdat on 10/19/2023 in #❓┊help
Dynamic form fields based on dependant fields
2 replies
FFilament
Created by ngoquocdat on 9/18/2023 in #❓┊help
404 on own panel
Why need this It must be show the dashboard but it doesn’t, but it shown 404 page
4 replies
FFilament
Created by ngoquocdat on 9/9/2023 in #❓┊help
Custom query in EditRecord
cool, thanks, I thought so before, but I didn't expect getEloquentQuery it work in EditRecord too.
10 replies
FFilament
Created by ngoquocdat on 9/9/2023 in #❓┊help
Custom query in EditRecord
Hmm, (if it works) it will cause n+1 issue
10 replies
FFilament
Created by ngoquocdat on 9/9/2023 in #❓┊help
Custom query in EditRecord
I mean i want to custom the query of current record to count the relationship. Currently $record->courses_count doesn't exists on $record because I haven't chain ->withCount('courses') to the query
10 replies
FFilament
Created by ngoquocdat on 7/2/2023 in #❓┊help
Form in page
okay, hh. btw, thank you
9 replies
FFilament
Created by ngoquocdat on 7/2/2023 in #❓┊help
Form in page
9 replies
FFilament
Created by ngoquocdat on 7/2/2023 in #❓┊help
Form in page
ok, thx i will check
9 replies
FFilament
Created by ngoquocdat on 7/2/2023 in #❓┊help
Form in page
thanks for reply me. but how to use group in blade view, is there mentioned in the docs?
9 replies
FFilament
Created by ngoquocdat on 7/2/2023 in #❓┊help
Form in page
9 replies
FFilament
Created by ngoquocdat on 5/20/2023 in #❓┊help
Generate form fields based on relationship when it was changed
Does the docs mention this, or where can I find out about the configuration method. Thx ❤️😅
8 replies
FFilament
Created by ngoquocdat on 5/20/2023 in #❓┊help
Generate form fields based on relationship when it was changed
Thank you, but it seems to only work with rendered fields. In my case: 1 category will have many attribute groups, and 1 group will have many attributes. So I want when the category is selected, will get all the groups of the category displayed as select field, and the attributes of that group will be the options of the select.
8 replies
FFilament
Created by ngoquocdat on 5/20/2023 in #❓┊help
Generate form fields based on relationship when it was changed
I trying this way but it doesn't works
public static function form(Form $form): Form
{
$attributeGroups = [];

return $form
->schema([
...$attributeGroups,
Select::make('category_id')
->relationship('category', 'name')
->required()
->reactive()
->preload()
->searchable()
->afterStateUpdated(function (string $state) use (&$attributeGroups) {
$groups = CategoryAttributeGroup::query()
->where('category_id', $state)
->isVisible()
->with('categoryAttributes')
->get();

$attributeGroups = $groups->map(function (CategoryAttributeGroup $group) {
return Select::make("attributes.{$group->id}");
})->toArray();
}),
public static function form(Form $form): Form
{
$attributeGroups = [];

return $form
->schema([
...$attributeGroups,
Select::make('category_id')
->relationship('category', 'name')
->required()
->reactive()
->preload()
->searchable()
->afterStateUpdated(function (string $state) use (&$attributeGroups) {
$groups = CategoryAttributeGroup::query()
->where('category_id', $state)
->isVisible()
->with('categoryAttributes')
->get();

$attributeGroups = $groups->map(function (CategoryAttributeGroup $group) {
return Select::make("attributes.{$group->id}");
})->toArray();
}),
8 replies