NotFoundHttpException in RouteCollection.php in laravel 5.4 - laravel

I created a new project via composer create-project laravel/laravel Test 5.4.* then i go to my browser to see my localhost if its working localhost/test/public and it works it redirect me to the welcome page, but when i tried to test
Route::get('/test', function(){
return 'TEST';
});
Then I go to my localhost/test/public/test it shows me error like
NotFoundHttpException: in RouteCollection.php (line 179)

is it a solved issue?
instead of localhost/test/public/test try localhost/test/public/index.php/test.
of course you can use laravel's own server. it is suitable for most developing usages.

Related

having issues with laravel 9 breeze , i have hosted it successfully everything working fine ... but breeze login and register wont work on production

this is my error on production level
Vite manifest not found at: /home/codarhqc/codar/public/build/manifest.json (View: /home/codarhqc/codar/resources/views/layouts/guest.blade.php) (View: /home/codarhqc/codar/resources/views/layouts/guest.blade.php)
You can delete the following file bootstrap/cache/config.php or better if you can make a route in your web.php file with a function that runs: php artisan optimize:clear.
This should remove the problem.

404 - NOT FOUND in laravel 8

I'm new to laravel and I've just installed the package on a local server.
I used php artisan serve to open the app
I made a simple route to test:
Route::get('a', function () {
return 'hi there';
});
but when I try to open this route I got 404 not found.

Laravel 5.4 php artisan route:list showing incorrect data after a route:clear

I have the following issue. I am running laravel 5.4 and have a problem with my routes, when I navigate to my '/about-me' of my predefined routes I get the error:
1/1 NotFoundHttpException in RouteCollection.php line 179:
However the route is defined as shows here:
Route::get('about-me', function () {
return view('about-me');
});
On my view the link is pointing to that route as shown:
About Me
I have cleared my cached routes in SSH using the command:
php artisan route:clear
When I list my routes using the command:
`php artisan route:list`
I see an old version of my routes file. So this is the problem, however whatever I try they are not updating. I have cleared the cache locally and within laravel and still the old file file is showing when I type the route:list command.
I believe the code is all correct, however the new updated route file which contains the defined route for about-me is not being used. I have attached an image of the updated routes file on the server also.
Here is a link to the screenshot. Screenshot of route file on server
Thanks
In Laravel 5.4 (or in earlier version, I'm not sure) routes has been moved to the separate folder in app/routes/web.php (as you can see here: https://github.com/laravel/laravel).
You can find routes registration in app/Providers/RouteServiceProvider.php (https://github.com/laravel/laravel/blob/master/app/Providers/RouteServiceProvider.php#L52)

NotFoundHttpException after following link in email

I'm trying to learn Laravel 5.3, so I'm doing my own password reset. In a "reset email" link, I'm sending myself the following link:
http://localhost:8000/users/newpassword/1/8ur7e1pvag6kx8nl0w
In my routes file I have:
Route::get('/users/newpassword/{$id}/{$remember}', 'UserController#newPassword')->name('usernewpassword');
However when I click the link, I'm getting: NotFoundHttpException in RouteCollection.php line 161:
I'm running this via artisan serve, so the port part of the link is correct.
I've also created the following method in the Users controller:
public function newPassword($id, $remember) {
return view('users.newpass');
}
Any ideas why this could be? Thanks!
You mistake in route file. It should be like this
Route::get('/users/newpassword/{id}/{remember}', 'UserController#newPassword')->name('usernewpassword');
Instead of this:
Route::get('/users/newpassword/{$id}/{$remember}', 'UserController#newPassword')->name('usernewpassword');
More about route parameters:
Laravel Route Parameters

Laravel 5.1 NotFoundHttpException in RouteCollection.php line 161

I have an error which you can see in this picture, and I don't know how to fix it. I am using Laravel 5.1.
Error:
Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 161
Either make your route something like in your Routes.php file from App\Http folder
Route::get('/laravel/alert/',function(){
//statement here
});
or change your page url to localhost/alert
Hope it will help you.
happyCoding
Assuming you Apache configuration is already pointed to your public folder in your project folder as DocumentRoot, it should able to work by accessing this route:
localhost/alert
I noted you use localhost/laravel/alert which looks wrong because you set your route to be /alert not laravel/alert
If you are not sure this is Apache or Laravel issue, run php artisan serve on the project folder and access the routes with this address, localhost:8000/alert

Resources