Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ecw_szilard97's avatar

Login won't working without php artisan serve

Hello there. I am newbie on Laravel so I have some problem with my project. If I wanna to access my project via public folder, it showing the welcome page, the form, but don't submitting the form. If I run php artisan serve and I try to access it it works all fine. But on the another case if I try to access it for ex. 192.168.213.21/project/public or localhost/project/public won't submit my form. What can be the problem? Sorry for my poor english.

0 likes
15 replies
ecw_szilard97's avatar

litteraly i wanna simulate how it will works on a server pc.

Snapey's avatar

when you don't use php artisan serve, what are you using?

siangboon's avatar

try use incognito mode... or clear your cache....

Webdevashish's avatar

-if you have .htaccess in root of your project, make sure it is not preventing you to access via public folder. -make sure you have csrf token in your form -make sure you have post route defined

ecw_szilard97's avatar

its not about routing. its something else and i dont know what can be the problem. I tried on a server and its working. Just on localhost won't work. I think is the session data or something like this...

Snapey's avatar
Snapey
Best Answer
Level 122

@ecw_szilard97 looking at your original question

if I try to access it for ex. 192.168.213.21/project/public or localhost/project/public won't submit my form.

This is wrong. you need to host the site so that the public folder is the document root

You can google how to setup virtual hosts with apache, or just use artisan serve

Please or to participate in this conversation.