Routes defined in api.php have api prefix defined automatically
Route::get('/api/mail/send', '[email protected]');
Route::get('/mail/send', '[email protected]');
I considered that as well but I still get the 404 when I do this: http://api.mywebsite.com/api/api/mail/send
Even when I created a new route: Route::get('/mailer', '[email protected]'); and did this I got a 404: http://api.mywebsite.com/mailer
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', 'MailControl[email protected]');
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?
laravel lives in /public whether you use api or not , try mywebsite/public
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.