I have this issue with homestead where it can't access any of my views instead it tells me NotFoundHttpException in RouteCollection.php line 145: (this is a new project) . When I try accessing an old laravel project which I made it works perfectly fine but when I create a new project it throws me this error. Now I have also tested it with php artisan serve and try accessing this on localhost:8000 and this works without problems. so why does homestead have problems?
NotFoundHttpException is actually thrown when there was no matching route found.
Seeing how it's working fine using artisan serve I think you should have a look wether the 'app' is setup properly in the Homestead configuration.
You can find more info on that here: https://laravel.com/docs/5.2/homestead#adding-additional-sites
In blade use url() funtion to route
for example
<a href='login'>test</a>
to
<a href='{{url("login")}}'>test</a>
And make sure that mod_rewrite in enable
Related
i am new to laravel world
i have downloaded an existing project
i have added the needed logic in a new controller and added the route for that controller to web.php
after that i tried to access the page but i was getting error 404
i thought it was something wrong with my controller so i have used the existing controller logic in my new route
i have restarted apache, mysql, laragon but still getting 404
the new route it almost like the existing one just copy past and added a character but still the old route works but not the new one
i am using laravel 9 with laragon
any advise ??
i have tried to restart laragon but it didnt work
You have too run:
php artisan route:clear
php artisan cache:clear
Route::get('/admin', 'Backend\HomeController#index')->name('admin.home');
is from routes/web.php and it's not working online. It's fine in local
Route::get('/superadmin', 'Backend\HomeController#index')->name('admin.home');
or any name except 'admin' is working online and local.
But I've already used /admin in my project in many places.
That's why I can't use /superadmin.
Please Help.
website backend:
http://ischebazar.com/admin
login:
http://ischebazar.com/admin/login is working.
I can't comment so I need to post an answer for this.
What do you mean by it does not work? Does it show you the laravel 404 page, a server error or a blank page?
If it shows you the laravel 404 page try clearing the route cache: php artisan route:clear.
If it's a blank page, try checking if you have a folder called admin in the document root of the project.
For a server error I can't guess whats wrong but you can provide additional information if this is the case.
Try executing the following command to clear out cache,
php artisan config:cache
Using Laravel 5.4. it's giving me an error of
NotFoundHttpException in RouteCollection.php line 161:
I'm uploading files under storage directory. I can see files in project-root/storage/app/files
Also I have created symlink using php artisan storage:link. When I visit the generated link (http://example.com/storage/files/RcDPA5N6FpTWCnnh2w8bQO85id53oAiCeZgITpwB.png)
though, it gives me not found exception.
Also I'm wondering if I'm referring resource then why route is being called.
That command will generate a symlink to app/storage/public so the files would need to go in app/storage/public/files and then they should be accessible via http://example.com/storage/files/RcDPA5N6FpTWCnnh2w8bQO85id53oAiCeZgITpwB.png.
I've uploaded an entire Laravel site. The first time everything was working fine.
Now I had an update and did the same thing all over again. Now the URLs are wrong. Whatever route I choose I get an
InvalidArgumentException in FileViewFinder.php line 137:
View [errors.404] not found.
I also see the following:
at FileViewFinder->findInPaths('errors.404', array('C:\xampp\htdocs\myApp\app\resources\views')) in FileViewFinder.php line 79
Which is really incorrect.
If I echo something in routes.php I can see the echo.
Update
The OP has website in shared hosting with-out SSH access to run artisan commands.
php artisan cache:clear
php artisan route:cache
Problem
Route cached: The OP uploaded local project into shared hosting with cached routes. Which caused routes conflict.
Laravel assumes c:\xampp\{project_name} to be local directory while it was different path.
Solution
The solution was to remove bootstrap\cache\ content (Cached routes)
I am creating a REST API with Laravel 5.2 and I'm also using MongoDB with the jenssegers/mongodb library. I have a virtualhost for my application so I can go to the url eg: http://myapp.local.com and simulate how it would be on the real server and as I have some other Laravel projects on dev right now, it is more organised to have them this way.
The virtualhost is pointing to the public folder of my application and it's working correctly.
This project is just starting so everything is being built right now. In order to check the database I created a very simple PostsController just to see if the connection and the results were returned correctly. I added Route::resource('/posts', 'PostsController'); in my routes.php so I could start doing some tests of basic CRUD operations.
When I use php artisan serve and access this route with http://localhost:8000/posts the results are brought correctly but when I try to access via http://myapp.local.com/posts I get this error:
FatalErrorException in Client.php line 56:
Class 'MongoDB\Driver\Manager' not found
Any ideas why this is happening?