Laravel "custom" routes always resolves to 404 - laravel

I'm using laravel 5.7 when I encounter 404 error on my custom routes along with the Route::resource entries on the same Route::group.
Format on web route
Route::group
Route::resource
Route::get
Symptoms:
Using route('something.page.custom') will resolve to expected URL.
Unsolvable by:
php artisan route:clear

This is not on the docs of Laravel 5.7 yet.
From resource first
Route::group
Route::resource
Route::get
To resource last
Route::group
Route::resource
Route::get
Seems like resource is cancelling the resolving for the custom routes.
Other solution:
If this won't work, disable the 404 exception catch and review the error stacks. But please let me know how to do that. :)

Related

Laravel on Apache 404 on routes. How to log full path of routes generated by Laravel

We have moved a Laravel project to a server running apache. The links in the app which should go to routes generated by laravel are all returning a 404 error.
I would like to log in the terminal the full paths of the the links generated by laravel.
php artisan route:list only lists the short version of the routes, is there a way to get the route starting with the https:// ?
I would be grateful for any tips.
I tried php artisan route:list but am only getting subroutes

How to access laravel api from vuejs frontend?

I have built a laravel api, I have placed the backend inside a laravel folder in the cpanel and the built vuejs frontend inside public_html, now u can see I am using both api.php and web.php, my frontend is working fine when I visit https://www.example.com but what's the url to my api endpoints since when I try something like https://www.example.com/api/somepage it doesn't work it just hits the routes I set using vue router?
Please I need help here I am a beginner, and thanks in advance.
Laravel apis have default middleware to establish security. Make sure you send tokens. In my opinion, test it in postman first.
If you have a 404 error , this link can help you
Sometimes it is possible that there is a problem with the route cache, so it is better to delete the route cache and create it again
php artisan route:clear
php artisan route:cache

How to set name for a laravel fortify route?

I'm a little curious, sorry for the silly question.
I wanted to get the route for login in the Laravel 8 + Fortify stack, it seems I cannot use "/login" directly because it will append on URL. so I wanted to use
{{ route('login') }}
But the problem is, it gives me an error 'route not defined'. When I'm running the command route:list it shows a blank name for login and register but has a name for 'logout'
I wonder how I can give a name for the fortify route, as it is not declared in the routes.web
Try:
php artisan route:clear
php artisan route:cache
This will clear all the route cache in Laravel.
You should Try :
php artisan optimize:clear
It help you clear your application cache route and config as well.

Route [auth.login] not defined. laravel 8

I'm getting this error out of a sudden after everything was working fine. ra
Although Auth::routes() is included, as a general rule, you can always check list of routes with names and middlewares by:
php artisan route:list
You'll probably see login not auth.login. auth.login is a view not route. If you can't find login you probably need to cache routes by:
php artisan route:cache

vue-router url can't find when its revisite/reload in laravel project

When i re hit the vue-router url its return 404 page not found.
I running it on laravel 5.8. in web.php file
I tried some of these but they don't work
Route::get('/{capture_all?}', 'HomeController#index')->where('capture_all', '[\/\w\.-]');
Route::get('/{vue_capture?}', 'HomeController#index')->where('vue_capture', '[\/\w\.-]');
Route::get('/{any}', 'HomeController#index')->where('any', '[\/\w\.-]');
the page will refreshed
Consider a fallback route:
Route::fallback('HomeController#index');
Any unknown route will be passed to this fallback route. Any known routes (like to your APIs) will remain untouched.

Resources