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].
I'm not sure if this is an issue with the Filament plugin or not as I found this:
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?
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:linkIf 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
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](https://private-user-images.githubusercontent.com/94101869/296605481-01df299a-1cc6-4dfe-87c6-16191cf95ec2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMTc5MTYsIm5iZiI6MTcyMDExNzYxNiwicGF0aCI6Ii85NDEwMTg2OS8yOTY2MDU0ODEtMDFkZjI5OWEtMWNjNi00ZGZlLTg3YzYtMTYxOTFjZjk1ZWMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDE4MjY1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY0N2RiOTRiM2I2NDRlM2MxNDQ3NGY2ODkyZThlYzEzOWEyMTlmYTQ2MTNjNjFjOGNkMWUyODUyNzRhNjlkYWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DdzXj9VXTojbD_qGfway04nmN9D4y_u8fdWUeQ1zelU)
![لقطة شاشة 2024-01-14 201001](https://private-user-images.githubusercontent.com/94101869/296605486-8718b7d8-0e51-4477-8609-e4c6db1122a1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMTc5MTYsIm5iZiI6MTcyMDExNzYxNiwicGF0aCI6Ii85NDEwMTg2OS8yOTY2MDU0ODYtODcxOGI3ZDgtMGU1MS00NDc3LTg2MDktZTRjNmRiMTEyMmExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDE4MjY1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJlZDE4ZmQyNWEyMGIwNTI0YmZiYzFiNzQyY2VkOTY1ODU3ZWMzZDYwZWVhNmEzNzY0YmJmOGQ2ZGY3NDM1N2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qLg93gO6Bu_XdYAHvx0pBbPLD60siMMxL0kuuY-9S5E)
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.