Laravel 5.1 NotFoundHttpException in RouteCollection.php line 161 - laravel

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

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.

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

Change root folder name

My Laravel project folder was "laravel" so i changed to "testsite", but now i cant access the site.
InvalidArgumentException in FileViewFinder.php line 137: View [pages.home] not found.
ErrorException in Filesystem.php line 109: file_put_contents(C:\Users\Zen\Google Drive\xampp\laravel\storage\framework/sessions/4d5b7c28f025c192658893a77c2d6bdb60b33d48): failed to open stream: No such file or directory
Full error can be found here:
PasteBin
Its visible in the paste that is something related with sessions from the old folder "laravel".
Using Xampp with virtualhosts, restarted Xampp, cleared browser cache, it didint solved the issue.
How can i fix this issue?
Problem solved, has described here: Laravel 5.1 View not found
php artisan cache:clear
php artisan config:cache
You have an inconsistent path, take a look of how you're setting the slashes:
xampp\laravel\storage\framework/sessions/
Besides that, make sure that the framework/session folder exists
Also check that pages.home hierarchy exists in your views folder:
View [pages.home] not found

Laravel 5 cache folder name causing classloader.php 412 error

When I uploaded my laravel 5 application to hostgator, i changed the name of one of the folders (instructor) that contains some controllers to (Instructors). However, I'm getting the error ErrorException in ClassLoader.php line 412
the applications is looking for controllers under the old folder name (instructor).
How can i fix this issue please?
Thank you
You can run the following command:
composer dumpautoload
perhaps u don't have controller.php file in the controllers folder under http folder of ur project.
Look for this file first..because in this file controller itself gets extended from basecontroller class, therefore it is necessary that this file should be there.

Resources