I have problem when upload it to Share Hosting
When I upload laravel + filament to Share Hosting, when I go to domain.com/admin, it show 404. Is there something that I have to do after upload the project?
12 Replies
Make sure this code implement in User model
public function canAccessPanel(Panel $panel): bool
{
return str_ends_with($this->email, '@yourdomain.com') && $this->hasVerifiedEmail();
}
https://filamentphp.com/docs/3.x/panels/usersShared hosting and Laravel are often a bad combination. It's hard to tell because there might be numerous issues with the server setup
It can work if having ssh terminal available. Your problem might be because of .htaccess, can you acces via /public/admin?
I'll try
I just have this account to make a light blog. To make this web secure I used to move the project directory in the outside of public_html
I cant π¦
as Dennis said, shared hosting is rubbish with laravel.. its not worth it for the money you are saving
You need to point the virtual host to
public
then
If you can't change the virtual host config, you will need to jump through some hoops.I think theres a problem when I upload it, so I reinstall the Filament via cpanel terminal. Everything goes fine even when I make filament-user. When I check the database there is my user data, but I cant access the admin page
Can you access any Laravel route?
Okay I will try it
Yes I can, just the filament page I cant access
have you tried adding this code to the User model?
public function canAcces Panel(Panel $panel): bool { return true; }
Yes I modified the User model like in Documentation and like this, still same (404)
Solution
Finally I fix it, I config the htaccess in the wrong way π