Good morning!!!
Silly question. I am working on Spatie Media Library building out the custom path generator. I have a line in there that looks like this:
return 'photos/' . $media->id;
}
What I need is something more like this
if ($media.attributes['colection_type'] == 'user_stories') {
return 'stories/' . $media->id;
}
In fact, IDEALLY I would want something more global so I am not writing 40 different if statements but if I have a static concept working I can refactor from there.
This obviously doesn't work. How would I structure this?
Thanks!