F
Filament4w ago
Rico

On domain (host) "/admin" returns 304

Hi, I'm not sure why but on my host when i go to /admin i get the 304 Forbidden.
No description
113 Replies
Rico
RicoOP4w ago
But also on my localhost works perfecttly.
Rico
RicoOP4w ago
Thank you, it worked! ❤️
Rico
RicoOP4w ago
I'm not sure why i get this server error every time when i acces the /dashboard route.
No description
Rico
RicoOP4w ago
I know why, im just not sure how to fix them.
Rico
RicoOP4w ago
Hosted
No description
Rico
RicoOP4w ago
Localhost
No description
Rico
RicoOP4w ago
those 2 charts, did i missed something?
awcodes
awcodes4w ago
Couldn’t tell you, anything in the logs on the server. Could be a server config about the livewire url, could be an error retrieving the records from the db. Just don’t have enough information without any log output.
Rico
RicoOP4w ago
All right, thank you so much i'll figure it out by myself, i have a idea is from the database, on local i use mysql on host sqlite.
awcodes
awcodes4w ago
We’re certainly willing to help but we need more information about what is happening than just showing there was a 500 error. 😀
Rico
RicoOP4w ago
[2025-05-05 21:25:46] staging.ERROR: SQLSTATE[HY000]: General error: 1 no such function: MONTH (Connection: sqlite, SQL: select MONTH(created_at) as month, count() as total from "users" where strftime('%Y', "created_at") = cast(2025 as text) group by "month" order by "month" asc) {"userId":2,"exception":"[object] (Illuminate\Database\QueryException(code: HY000): SQLSTATE[HY000]: General error: 1 no such function: MONTH (Connection: sqlite, SQL: select MONTH(created_at) as month, count() as total from "users" where strftime('%Y', "created_at") = cast(2025 as text) group by "month" order by "month" asc) at /home/forge/parfumer-staging.twodevs.ro/vendor/laravel/framework/src/Illuminate/Database/Connection.php:822) Yea, i feel so good that you guys are ready to help, but my goal is to learn. 😊 From db.
awcodes
awcodes4w ago
Are you sure you’re on sqlite locally. Month isn’t an sqlite function. Or if it is the sqlite version might be out of date and their docs are out of date too.
Rico
RicoOP4w ago
Noo, on local i'm on mysql, on host i'm on sqlite.
awcodes
awcodes4w ago
Well, that’s your problem.
Rico
RicoOP4w ago
Yes
awcodes
awcodes4w ago
You need to use MYSQL on the server or change your code to not depend on MySQL functions.
Rico
RicoOP4w ago
I fix it, I've changed the envoierment in .env from sqlite to mysql and added the credentials
awcodes
awcodes4w ago
That’ll do it too.
Rico
RicoOP4w ago
😊
awcodes
awcodes4w ago
Glad you got it working.
Rico
RicoOP4w ago
Thank you so much again.
awcodes
awcodes4w ago
No worries.
Rico
RicoOP4w ago
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
Rico
RicoOP4w ago
Everything work perfectlly but i am not sure how to show in frontend the image
Rico
RicoOP4w ago
No description
Rico
RicoOP4w ago
Debugging:
No description
No description
Rico
RicoOP4w ago
Frontend
No description
awcodes
awcodes4w ago
Did you link the storage directory with php artisan storage:link
Rico
RicoOP4w ago
Yes
Rico
RicoOP4w ago
No description
awcodes
awcodes4w ago
What does the console in the browser show?
Rico
RicoOP4w ago
No description
Rico
RicoOP4w ago
The path probreabbly is not the good one.
awcodes
awcodes4w ago
Something is off with your disk. If the storage link was correct out of the box the url would be /storage/image/file.jpg.
Rico
RicoOP4w ago
im just hardcoding to check
Rico
RicoOP4w ago
No description
awcodes
awcodes4w ago
In your frontend view you probably need to use the Storage facade for the src attribute.
Rico
RicoOP4w ago
how, i have no idea 🥺
awcodes
awcodes4w ago
src=“{{ Storage::disk(..)->url(…) }}”
Rico
RicoOP4w ago
I use laravel breeze with vue and inertia
awcodes
awcodes4w ago
Read through the laravel docs on how the storage works.
Rico
RicoOP4w ago
Im not sure this will work all right
awcodes
awcodes4w ago
Storage and URLs in filament aren’t relative to filament they all fall back to Laravel’s filesystem
awcodes
awcodes4w ago
File Storage - Laravel 12.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Rico
RicoOP4w ago
I was reading that
awcodes
awcodes4w ago
I would recommend, taking some time to work through Laravel itself, instead of trying to learn Laravel through filament. But not judging, just think it will benefit you more in the long run. Filament depends on Laravel, not the other way around. But I love your hustle.
Rico
RicoOP4w ago
Thank you, i think i've found the problem for my images
Rico
RicoOP4w ago
No description
Rico
RicoOP4w ago
No description
Rico
RicoOP4w ago
I have an idea wait Thank you, i've learned and understand the MVC, relationships between models etc, its my first time doing images now i am learning them :))
awcodes
awcodes4w ago
All good. Just trying to help.
Rico
RicoOP4w ago
Yes, thank you.
awcodes
awcodes4w ago
I don’t always have the answers but if I can help you find the answers then I’m happy. I’d rather you discover and understand it than to give you copy and paste code.
Rico
RicoOP4w ago
I love that, i appriciate so, when i create a product and upload images the images saves like that
Rico
RicoOP4w ago
No description
Rico
RicoOP4w ago
i'm not sure if is ok something seems off
awcodes
awcodes4w ago
The images would save to a relative path to the disk,
Rico
RicoOP4w ago
and if i go to this path
No description
awcodes
awcodes4w ago
The disk could be local or s3 etc
Rico
RicoOP4w ago
i see the image
awcodes
awcodes4w ago
The whole point is that the url path in the database is independent That’s where the storage facade disk comes into play. It allows for physically storing the file in multiple environments, without changing the path in the database.
Rico
RicoOP4w ago
i understand now FIX IT yes
Rico
RicoOP4w ago
No description
Rico
RicoOP4w ago
Love you for not copy pasting me. and letting me understood how it works
awcodes
awcodes4w ago
Glad you want to understand it vs a copy paste solution.
Rico
RicoOP4w ago
yeah, and i'm trying not to use AI as hard as i can
awcodes
awcodes4w ago
Time and place for everything. But I respect you for it.
Rico
RicoOP4w ago
Thank you. 😊 if i give the link to my github repo to throw an eye on the project to see if i am on a good path, will you?
awcodes
awcodes4w ago
Sure. Just PM it. But also keep in mind that I don’t have all the answers, and good to me isn’t alway good to the client or company. But I’m happy to help when and where I can. I do have a day job, so not always readily available. 😅
Rico
RicoOP4w ago
no problem i've sended you the pm
awcodes
awcodes4w ago
But I’m ok with a mentor type role. Assuming you trust me to be such.
Rico
RicoOP4w ago
today i've learned a lot, not gonna lie, i was focusing on deploying the project on a host, creating a subdomain connecting it, uploading the project to the host all those stuff are so amaizing to actually see how it works everything
awcodes
awcodes4w ago
I hear yea, but domains also get into more IT type situations, but just focus on one thing at a time.
Rico
RicoOP4w ago
i can't, everythink is so easy i dont see a challange to take one thing at a tiem
awcodes
awcodes4w ago
It’s easy until it isn’t. Just saying. 😂
Rico
RicoOP4w ago
i'll wait your feedback on the project, im exited about that
awcodes
awcodes4w ago
But understanding all the underlying concepts will make everything else easier.
Rico
RicoOP4w ago
yes i agree
awcodes
awcodes4w ago
But it’s a lot to learn them all up front. Nothing wrong with one thing at a time.
Rico
RicoOP4w ago
yea, i'm a little bit random, i knew that i dont need to buy a host and a domain right now but just wanted to do that to learn and i leaved the project for a few hours, reading on the internet what i need and Just do it.
awcodes
awcodes4w ago
I’m the king of random and breaking it. You’re good.
Rico
RicoOP4w ago
haha how old are you?
awcodes
awcodes4w ago
Too old I’m still ok with FTP if that tells you. 😂
Rico
RicoOP4w ago
🤣
awcodes
awcodes4w ago
And my first IDE was notepad.
Rico
RicoOP4w ago
No way 🤣
awcodes
awcodes4w ago
There was 0 syntax highlighting when I started. I’m really not technically that old but in tech terms I am.
Rico
RicoOP4w ago
omg i'm just a kid in front of you :))
awcodes
awcodes4w ago
Tech is tech. Age is only the possibility of experience. But I’ve been doing this for 20+ years and I still know that I don’t know everything.
Rico
RicoOP4w ago
I have 22 yo..
awcodes
awcodes4w ago
I’m 45 😂
Rico
RicoOP4w ago
god damn.
Rico
RicoOP4w ago
I'm not sure why but on the getGalleryImagesAttribute method if i change from main to imagesi get the array of the images
No description
No description
No description
Rico
RicoOP4w ago
No description
No description
Rico
RicoOP4w ago
But i get this:
No description
Rico
RicoOP4w ago
again
Rico
RicoOP4w ago
No description
Rico
RicoOP4w ago
the main image works, the gallery of the images not
awcodes
awcodes4w ago
Did you run php artisan storage:link
Rico
RicoOP4w ago
Yes
awcodes
awcodes4w ago
Hmm, forbidden is a weird error for that
Rico
RicoOP4w ago
works, is showing the image
No description
Rico
RicoOP4w ago
here, 403 forbbiden
No description
awcodes
awcodes4w ago
Sorry, probably not the best person to ask when using the spatie package. I tend to not use it.
Rico
RicoOP4w ago
what is spatie package? 🤣
"require": {
"php": "^8.2",
"filament/filament": "3.3",
"filament/spatie-laravel-media-library-plugin": "^3.3",
"inertiajs/inertia-laravel": "^2.0",
"laravel/framework": "^12.0",
"laravel/tinker": "^2.10.1",
"spatie/laravel-medialibrary": "^11.12",
"tightenco/ziggy": "^2.4"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.2.2",
"laravel/pint": "^1.18",
"laravel/sail": "^1.41",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"pestphp/pest": "^3.8",
"pestphp/pest-plugin-laravel": "^3.2"
},
"require": {
"php": "^8.2",
"filament/filament": "3.3",
"filament/spatie-laravel-media-library-plugin": "^3.3",
"inertiajs/inertia-laravel": "^2.0",
"laravel/framework": "^12.0",
"laravel/tinker": "^2.10.1",
"spatie/laravel-medialibrary": "^11.12",
"tightenco/ziggy": "^2.4"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.2.2",
"laravel/pint": "^1.18",
"laravel/sail": "^1.41",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"pestphp/pest": "^3.8",
"pestphp/pest-plugin-laravel": "^3.2"
},
this?
filament/spatie-laravel-media-library-plugin
filament/spatie-laravel-media-library-plugin
awcodes
awcodes4w ago
Yep
Rico
RicoOP4w ago
oh
awcodes
awcodes4w ago
There’s nothing wrong with it, I just tend to do my media management differently. So, don’t really use the package.
Rico
RicoOP4w ago
ohh, all right, i will figure it out
Dennis Koch
Dennis Koch4w ago
@Rico It would be good if you open new threads for new issues so other people can help without having to dig through 145 messages
Rico
RicoOP4w ago
Sure, sorry.

Did you find this page helpful?