Support the ongoing development of →
Last updated 1 year ago.

Routes defined in api.php have api prefix defined automatically

Change this

Route::get('/api/mail/send', 'MailController@index');

to this

Route::get('/mail/send', 'MailController@index');
Last updated 4 years ago.

I considered that as well but I still get the 404 when I do this:

Even when I created a new route: Route::get('/mailer', 'MailController@index'); and did this I got a 404:

So not sure what I am doing wrong?


If you have your nginx configured correctly for api subdomain (I am not very experienced in nginx) you need to access:

if you have this route inside api.php

Route::get('/mailer', 'MailController@index');
Last updated 4 years ago.

Hmm yeah thats exactly what I have and tried, so I feel it must me my nginx setup which I also do not have experience (first time deploying my laravel api to production). Maybe someone here hass some experience


ah found the problem maybe: root /mywebsite/api/public; should have been root /root/mywebsite/api/public;

But when I do this I new get a 403?

Last updated 4 years ago.

laravel lives in /public whether you use api or not , try mywebsite/public


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.