Emmanuel71
How to use a custom path with spatie media library plugin?
@ChesterS Thanks for pointing me in the right direction! It works now! After publishing the config, I tested with a custom generator per model and it worked. For my case however I just created one CustomPathGenerator that creates a subfolder per model and per Ym. I made a gist for it: https://gist.github.com/EmmArro/ba5b67986585550b140ee64554902135
13 replies
How to use a custom path with spatie media library plugin?
@toeknee Yes, it is Ym.
@ChesterS Thanks for sharing this, but after installing filament/spatie-laravel-media-library-plugin there is not even a config file for the media-library. So I guess this plugin simply does not have all functionality of the complete spatie media library. I also tried to override the Media model and use a getPath function like this:
public function getPath(string $conversionName = ''): string
{
// Define path structure, for instance: 'images/YYYYmm/media_id'
Log::info('Media getPath() called');
return 'images/' . now()->format('Y') . now()->format('m') . '/' . $this->getKey() . '/';
}
But my log message never appears in the log, so I gues that's also not an option.13 replies
Filament on offline production server: blank components
Thx for the help. Still stuck however.
-All table are present in staging/production and have the correct permissions/structure.
-I know it's not ideal to have to manually install vendor, but since there is no internet connection..., I also tried through git but we ran into problems.
-Unfortunately the node modules need also to be zipped & moved over. I also double checked this for the correct version.
Some 'progress' : the user table on production and staging was different from the one in local dev. I need to use a custom user table in my apps. After installing the alternate user table in local dev, the dashboard also displays empty components in local dev. So probably the dashboard problem and the resource problem are not related. I implemented the getFilamentName() function on the user model, but the dashboard problem remains.
9 replies