How to change Base URl of a website - Laravel 5.4 - laravel

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

Related

I have removed a route from web.php and this route still working in laravel 5

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

Laravel Password reset link is pointing to old APP_URL

I have a Laravel 8 project which is using Laravel/UI for auth.
I changed the APP_URL in the .env file from the test domain extension to IP Address. But the password reset email is showing a link with the previous APP_URL as the base URL.
The following are steps that I have tried to solve this:
Change APP_URL in .env file
Change URL in config/app.php to the IP address instead of env variable.
Ran php artisan config:clear
Ran php artisan cache:clear
Ran php artisan optimize:clear
How can I solve this?
Try running these commands:
php artisan config:cache
php artisan queue:restart
The issue was with url from where I was submitting the form. Laravel/UI reset password uses route() method to get the url for the password reset. Hence why the change in APP_URL and url variable didn't affect the link. A detailed explanation is available here

Why always i clear route and cached route when new created?

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

Laravel routes not updating on server

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

Lumen php artisan config:cache not found

I'm trying out the PHP micro Framework Lumen (from laravel).
When I set up Lumen and I try to use the php artisan config:cache command like in Laravel, I get this error :
[InvalidArgumentException]
There are no commands defined in the "config" namespace.
So I have problem when I try to deploy the files to server, so I have to change .env file to change the database username and password.
This makes me think config is not available in artisan
How can I add it to artisan ?
Yes, you can not use the php artisan config:cache with your Lumen project, because it is not available out of the box.
You can add it by adding this package (orumad/lumen-config-cache) to your project:
composer require orumad/lumen-config-cache
In lumen you have to add this configuration in bootstrap/app.php file
$app->configure('custom_config_file_name');
#example
$app->configure('custom_emails');
Then you can access like below:
config('filename.key_name');
#example
config('constants.email');
Lumen no need to config:cache.
You do not need to do anything after change ‍‍.env

Resources