Log1x/filament-starter

Call to undefined relationship [url] on model [Awcodes\Curator\Models\Media]

Closed this issue · 11 comments

When "toggling" the List View icon on the Media resource listing page, the following error is thrown:

Call to undefined relationship [url] on model [Awcodes\Curator\Models\Media].

Screen Shot 2024-01-14 at 10 25 30 AM

I'm not sure if this is an issue with the Filament plugin or not as I found this:

awcodes/filament-curator#417

Interesting about CuratorColumn getting deprecated but I can't seem to reproduce this. I added a few images to the media library and seem to be able to toggle between List/Grid without any issues.

The only place we attempt to use ->url is on the figure view component and the post.show full page component which are unrelated to Filament it's self.

Anything else I could try to reproduce this?

لقطة شاشة 2024-01-14 195434

the image does not display in sharing host

Did you already link your storage on production with Artisan?

php artisan storage:link

If so, can you provide me the URL you are getting and what it is otherwise supposed to be?

Did you already link your storage on production with Artisan?

php artisan storage:link

If so, can you provide me the URL you are getting and what it is otherwise supposed to be?

i have added but still does not work

yes , i did but not work
لقطة شاشة 2024-01-14 195935

Do you see the media on your server?

What is the URL you are seeing for the broken images so we can narrow down what is potentially happening?

the correct URL is https://my website url /storage/media/35dc9fcc-ab53-4c6e-babe-0c28c7cd207e.png?w=40&h=40&fit=crop&fm=webp&s=e9e9bd1ed5fca2e5aa90872a555beb33

i got this
/uploader/media/35dc9fcc-ab53-4c6e-babe-0c28c7cd207e.png?w=640&h=320&fit=crop&fm=webp&s=3ad4422521f3efd3ed466c062603d18c

I have solved this problem by changing the 'route_path' => 'Curator' to 'route_path' => 'storage'

in config file => curator.php

I'm not familiar with what /uploader/ would be coming from. Have you edited any of the configs that would be related to this? Is it possible your server is blocking a function that is required by Glide?

Otherwise, I see route_path set here in Curator but I'm not sure that you'd want it to be storage. 🤔

image لقطة شاشة 2024-01-14 201001

When I changed the value of 'route_path' from 'Curator' to 'storage', the functionality worked as expected. By the way, I didn't make any other edits except for the 'route_path' value change. However, I also added 'route_path' => 'uploader' to check if it would affect the path. It did change the path to

"/uploader/media/35dc9fcc-ab53-4c6e-babe-0c28c7cd207e.png?w=640&h=320&fit=crop&fm=webp&s=3ad4422521f3efd3ed466c062603d18c".

Then, I attempted to replace "uploader" with "storage", and this modification also produced the desired results.

Appreciate you posting your solution. I haven't been able to reproduce this on my end in production but if I do I'll be sure to update this or take the necessary steps to ensure nobody else has this issue.

Going to close this for now as I feel like it is environment-specific or not entirely related to the starter.