F
Filament4mo ago
tomc

How I create images urls with "filament spatie media library" ?

How I create images urls with "filament spatie media library" ? if yes How do I do that, i am working with filament-api-service so I can make those image urls available for my frontend.
9 Replies
tomc
tomc4mo ago
thanks @awcodes however I switched to curator, but I don't see the media resource and also I noticed that the migration has changed to a curator, What got me interested was the factthat curator automatically generates urls/file_path upon image upload. Is there a way I can mimic that behaviour?
awcodes
awcodes4mo ago
so you know, Curator doesn't work with Spatie Media
tomc
tomc4mo ago
yes, I took note of that
awcodes
awcodes4mo ago
as long as you added the CuratorPlugin::make() to your plugins array in your panel service provider the resource should be showing.
awcodes
awcodes4mo ago
see here to start with to see how Curator overrides the default upload functionality for the fileupload field. https://github.com/awcodes/filament-curator/blob/3.x/src/Components/Forms/Uploader.php
GitHub
filament-curator/src/Components/Forms/Uploader.php at 3.x · awcodes...
A media picker plugin for Filament Panels. Contribute to awcodes/filament-curator development by creating an account on GitHub.
tomc
tomc4mo ago
yeah I did However I get this error
Error

Call to undefined method Awcodes\Curator\CuratorPlugin::navigationCountBadge()

at app\Providers\Filament\AdminPanelProvider.php:80
76▕ ->pluralLabel('Media')
77▕ ->navigationIcon('heroicon-o-photo')
78▕ ->navigationGroup('Content')
79▕ ->navigationSort(3)
➜ 80▕ ->navigationCountBadge()
81▕ ->registerNavigation(false)
82▕ ->resource(\App\Filament\Resources\CustomMediaResource::class),
83▕ FilamentSpatieLaravelHealthPlugin::make()
84▕ ])

1 vendor\filament\filament\src\PanelProvider.php:15
App\Providers\Filament\AdminPanelProvider::panel(Object(Filament\Panel))

2 vendor\laravel\framework\src\Illuminate\Collections\helpers.php:224
Filament\PanelProvider::Filament\{closure}()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Error

Call to undefined method Awcodes\Curator\CuratorPlugin::navigationCountBadge()

at app\Providers\Filament\AdminPanelProvider.php:80
76▕ ->pluralLabel('Media')
77▕ ->navigationIcon('heroicon-o-photo')
78▕ ->navigationGroup('Content')
79▕ ->navigationSort(3)
➜ 80▕ ->navigationCountBadge()
81▕ ->registerNavigation(false)
82▕ ->resource(\App\Filament\Resources\CustomMediaResource::class),
83▕ FilamentSpatieLaravelHealthPlugin::make()
84▕ ])

1 vendor\filament\filament\src\PanelProvider.php:15
App\Providers\Filament\AdminPanelProvider::panel(Object(Filament\Panel))

2 vendor\laravel\framework\src\Illuminate\Collections\helpers.php:224
Filament\PanelProvider::Filament\{closure}()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
the
->resource(\App\Filament\Resources\CustomMediaResource::class),
->resource(\App\Filament\Resources\CustomMediaResource::class),
is also giving same error:
Undefined type 'App\Filament\Resources\CustomMediaResource'.intelephense(P1009)
Undefined type 'App\Filament\Resources\CustomMediaResource'.intelephense(P1009)
tomc
tomc4mo ago
I think it might be from my panel then, something might have been broken
Want results from more Discord servers?
Add your server
More Posts