Garrita
Garrita
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
17 replies
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
After many ways to handle this, I ended up with the solution!!
17 replies
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
Ohh, gotcha, thanks anyway, I'll try to debug it and see if there is a bug in the package.
17 replies
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
17 replies
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
I've tested it using just FileUpload and it works, but SpatieMediaLibrary does not work
17 replies
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
I'll be really glad to you to test it
17 replies
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
Hi @awcodes I've just created it https://github.com/javierpomachagua/filament-demo just clone it composer install php artisan filament:user and that's all. There are User and Profile models (Profile belongsTo User and User hasOne Profile). The avatar image is from the User so when I created it in the ProfileResource using Group and relationship does not work, I only save the attributes for User except the files.
17 replies
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
the resource is for the child AuctionCarResource, so in the form I create it along with the parent (Car), so that's why I use the relationship function in the group component, but for some reason the spatie media library is not working on create, just edit, I've researched in issues, pr, and documentation of course but nothing found.
17 replies
FFilament
Created by Garrita on 9/13/2024 in #❓┊help
Save Spatie Media Library File in Relationship
No description
17 replies
FFilament
Created by Garrita on 6/13/2024 in #❓┊help
Error when switching tabs in Relation Manager
Oh man thanks so much!!! I forgot the upgrade command, awesome! have a good one!
5 replies
FFilament
Created by Garrita on 6/13/2024 in #❓┊help
Error when switching tabs in Relation Manager
taking a look to it @nanopanda
5 replies
FFilament
Created by Garrita on 4/4/2024 in #❓┊help
Select Relationship Modify Query Using
I didn't know that we could inject those parameters in modifyQueryUsing omg, thanks!
8 replies
FFilament
Created by Garrita on 4/4/2024 in #❓┊help
Select Relationship Modify Query Using
Solved
Select::make('car_id')
->label('Car')
->relationship(
name: 'car',
titleAttribute: 'name',
)
->options(function (?Model $record): array {
return Car::query()
->doesntHave('auction')
->orWhere('id', $record?->car_id)
->get()
->pluck('name', 'id')
->toArray();
})
->required()
Select::make('car_id')
->label('Car')
->relationship(
name: 'car',
titleAttribute: 'name',
)
->options(function (?Model $record): array {
return Car::query()
->doesntHave('auction')
->orWhere('id', $record?->car_id)
->get()
->pluck('name', 'id')
->toArray();
})
->required()
8 replies