I have added a Laravel route to the web.php file and everything works fine locally but on deployment, it says that page is not found. The thing is that the newly added routes seem to be in web.php on the server as well but php artisan route:list does not display these new routes. Most of the solutions here recommend to run php artisan route:clear and then php artisan route:cache but there is not any routes.php file in /bootstrap/cache/ directory so that routes were not caching anyways.
Dont run route:cache
just clear and it will auto get it cached from your routes
php artisan route:clear
php artisan config:clear
Related
How can I remove the debugbar routes?
In my .env file I already included
DEBUGBAR_ENABLED=false
APP_DEBUG=false
I also run the ff. commands
php artisan optimize:clear
php artisan config:clear
but nothing.
The debugbar won't show in screen but it has routes when I do php artisan route:list. Please help. Thanks
you cannot!
you can just disable the debugbar as you did. The routes are registered with the package, so the only way to remove them is to remove the package from your project.
Using the php artisan route:list will show you the routes for API and Web.
It's not about debugging true or false. It's about the routes that were used in the application. If debug was true then it will show you the necessary configuration given in the .env file. At the same time, it will also show you the error messages including the variable name method and where the error occurs.
I am working in laravel 5 an existing project downloaded from cpanel. I want to make some changes but my changes do not have any affect. I, at the end remove the route but route still working. There is no any extra route file binding in routeServiceProvider not required or included in web.php. I am wondering how it could be happened?
I have tried:
php aritsan cache:clear
php artisan config:clear
can somebody please tell me what could be the issue ?
please run the following:
php artisan route:cache
After running this command, your cached routes file will be loaded on every request.
Please, run the following command:
php artisan route:clear
I am using Laravel 8 and I am facing issue with route. When I create a route it does not appear in route list after running below command
php artisan route:clear
php artisan route:cache
I get all route. How can i solve it. Why i run these command for new routes?
From the docs:
Optimizing Route Loading
If you are building a large application with many routes, you should
make sure that you are running the route:cache Artisan command during
your deployment process:
php artisan route:cache
This command reduces all of your route registrations into a single
method call within a cached file, improving the performance of route
registration when registering hundreds of routes.
You should only run php artisan route:cache during deployment, while you develop locally you shouldn't cache your routes, otherwise new routes that you create wont be registered until you run php artisan route:clear or php artisan route:cache again.
php artisan route:cache
// clears the route cache and then re caches the routes
php artisan route:clear
// clears the route cache
I have a website based on laravel 5.4. The site is working fine on my localhost. But when I upload it on my shared hosting. It is giving me an error
"at FileViewFinder->findInPaths('welcome', array('C:\\xampp\\htdocs\\lrl\\resources\\views'))"
C:\xampp\htdocs\lrl\resources\views this is my localhost URL. How can I changed this URl. I have made changes in .env file and I put all the files of public folder at root directory. Also I changed Appserviceprovider.php file.
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Schema;
use DB;
use View;
use Request;
I also cleared the cache but still i am getting this error shown in screenshot
run php artisan config:cache
C:\xampp\htdocs\lrl\resources\views is cached in your config file. So, you must clear config cache by run artisan command php artisan config:cache.
Clear you route cache
php artisan route:cache
Clear all if still not work
php artisan config:cache
php artisan config:clear
php artisan view:clear
I just have installed voyager at laravel 5.4 and tables migrated but at the end it shows following error
Route [voyager.posts.index] not defined
As mentioned by #Muhammad Muazzam
1- Run php artisan voyager:install
However, only this didn't work for me, I needed to also
2- Clear php catch: php artisan optimize:clear
Re runing php artisan voyager:install will resolve the issue.