This is old question but is active yet.
for windows users if you using CAPITAL characters (upper-case letter) in your project folder you should using same in your browser.
If your project is in "c:\xampp\htdocs\MyProject\" you should using MyProject as url instead of myproject
for example in the above project (MyProject) following route:
Route::get('/dashboard', function () {
return 'welcome to dashboard!';
});
will work if you use:
http://MyProject/dashboard
but is better using lowercase characters in directories
Changing the server port worked for me after trying several fixes all to no avail. I was running on loalhost:3000 and changed to localhost:4000. I think this might have to do with some memory cahe
and then type this and see whether your route exists in the list
php artisan route:list
and also in Middleware\VerifyCsrfToken.php check post routes are allowed
class VerifyCsrfToken extends Middleware {
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'api/*'
];
}
I had the same issue recently and I thought I was using a Reserved word, which I couldn't find in the list of reserved words of PHP.
Originally my Routes/web.php was:
After I changed to another name as shown bellow, it worked!
What's weird is that I have other working routes such as:
Although it's not an explanation of the causes of the problem, perhaps this workaround can help you.
This is old question but is active yet. for windows users if you using CAPITAL characters (upper-case letter) in your project folder you should using same in your browser. If your project is in
"c:\xampp\htdocs\MyProject\"
you should usingMyProject
as url instead ofmyproject
for example in the above project (MyProject) following route:will work if you use:
but is better using lowercase characters in directories
Please Make you have Apache configured with the following information
Add the following information
.htaccess file located in public folder make sure that it has the following
Remember to enable mod_rewrite module
Changing the server port worked for me after trying several fixes all to no avail. I was running on loalhost:3000 and changed to localhost:4000. I think this might have to do with some memory cahe
try
and then type this and see whether your route exists in the list
and also in Middleware\VerifyCsrfToken.php check post routes are allowed
I had the same Issue & resolved it by changing the way I ordered the Routes
This is before
This is after (and the that 404 disappeared)