Log1x / filament-starter

A beautiful starting point for your next TALL stack project using Filament. ⚡
https://github.com/Log1x/filament-starter
MIT License
368 stars 55 forks source link

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

Closed rthomas023 closed 5 months ago

rthomas023 commented 5 months ago

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:

https://github.com/awcodes/filament-curator/issues/417

Log1x commented 5 months ago

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?

YacoubAl-hardari commented 5 months ago
لقطة شاشة 2024-01-14 195434

the image does not display in sharing host

Log1x commented 5 months ago

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?

YacoubAl-hardari commented 5 months ago

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

YacoubAl-hardari commented 5 months ago

yes , i did but not work

لقطة شاشة 2024-01-14 195935
Log1x commented 5 months ago

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?

YacoubAl-hardari commented 5 months ago

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

YacoubAl-hardari commented 5 months ago

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

in config file => curator.php

Log1x commented 5 months ago

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. 🤔

YacoubAl-hardari commented 5 months ago
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.

Log1x commented 5 months ago

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.