How to remove a package from laravel which has providers? - laravel

I tried to install Vanilo E-Commerce onto my existing application which clashed with a lot of my migrations thus I want to now remove it.
I tried to run
composer remove vanilo/framework
Which removed everything but then gives me the error:
Class 'Konekt\AppShell\Providers\ModuleServiceProvider' not found
Whenever I attempt to do anything. I believe this comes from when you do:
php artisan vendor:publish --provider="Konekt\Concord\ConcordServiceProvider" --tag=config
How can I remove this provider? I cannot find it in my config/app.php or anywhere else.

You have to delete config/concord.php since that is where Konekt\AppShell\Providers\ModuleServiceProvider is referenced

Try to clear config cache:
php artisan config:cache (clears and caches it again, you can also use clear if I remember it correctly)
You can also try to clear the application cache:
php artisan cache:clear

Related

Please how can I undo ''php artisan livewire:make product-ratings''

After running the command I realized that I don't want to use it again so I deleted the two components it created which are
CLASS: app/Http/Livewire/ProductRatings.php
VIEW: resources/views/livewire/product-ratings.blade.php
Now when I try to access my product in the frontend I get this error
include(C:\xampp\htdocs\keyi\vendor\composer/../../app/Http/Livewire/ProductRatings.php): Failed to open stream: No such file or directory
2 possibilities
You have actually deleted it but it still thinks its there so do php artisan view:clear
or
It seems like you are trying to access a Livewire component that has been deleted, but your application is still trying to include it. This is causing the error message "include(C:\xampp\htdocs\keyi\vendor\composer/../../app/Http/Livewire/ProductRatings.php): Failed to open stream: No such file or directory".
To resolve this issue, you will need to remove any references to the deleted Livewire component from your code. This could include removing references to it in your routes, controllers, views, or other parts of your application.
Once you have removed all references to the deleted component, you should be able to access your product in the frontend without encountering the error message. If you continue to have trouble, you may want to check your logs or run your application in debug mode to get more information about the problem.
Did you try livewire:delete
php artisan livewire:delete product-ratings
and run
php artisan cache:clear
php artisan config:clear
composer dump-autoload # if needed
saw this command in the web livewire:remove.(Not sure if exist)
php artisan livewire:remove product-ratings

Laravel cached routes file access, version 5.8

Okay so I want to access the cached file of routes in Laravel version 5.8 I know that there is somewhere Laravel saves this file but I am not sure where to look for it.
I already tried to check the these folders
Storage
Bootstrap
But I couldn't find the route cache file. All I find is cached views and cached services and packages but there is no cache file.
Really Thank you for your time :)
It's in bootstrap/cache/routes.php.
The command php artisan route:cache or php artisan optimize (re)creates this file.
The command php artisan route:clear deletes this file.

127.0.0.1:8000 keeps on loading in a laravel project

I have a laravel project but when I use the command "php artisan serve" and type the url: http://127.0.0.1:8000/ , its just keep on loading without output nor error appear.
I solved this by running this command instead of PHP artisan serve.
php -S 127.0.0.1:8000 -t public/
Then try to load again 127.0.0.1:8000 in your browser.
Try disabling your anti-virus or check your firewall.
I disabled my Avast anti-virus and it's working fine for me now.
The port 8000 might be used by other in your computer. Try to change port by running in your project in cmd:
php artisan serve --port=1000
then type http://127.0.0.1:1000/ on your browser.
Run commands
php artisan config:clear
php artisan config:cache
Even after completing these steps, if Laravel is still showing error, check your_project/storage/logs/laravel.log.
Try these three commands for clearing cache config:
php artisan config:cache // clear config cache
php artisan config:clear // clear config cache
php artisan cache:clear // clear cache
php artisan optimize // To reoptimize the class loader
php artisan route:cache // clear route cache
php artisan view:clear // clear view cache
It sometimes happen because of too many redirection and also sometime because of middleware . so see your whole flow for that page.
Also see your cdn which included in your page because it take too many time if you have too many cdn and your connection is slow. And also try to clear all cache.
I experienced this problem also when I first launched out into Laravel.
Your port 8000 is most likely occupied by another service or program.
Simply go to your terminal where your project is open, and enter the following command
php artisan serve --port=1000
Then, return to your browser and enter the address, replacing 8000 with 1000, as in
127.0.0.1:1000
This worked for me.
There are several issues may be possible for that.
You have used CDN JS and CSS
Check you route/web.php
Check you log error log file storage/logs/laravel.log
Check above points this will sure give you positive result.
In my case I uninstalled Xampp and reinstalled it(I'm assuming you are using Xampp too).It worked for me.
If you are using xampp
just restart Apache and MySql

php artisan serve does not allow change .env file

I found the problem
if i restart php artisan serve the changed values are applied. this is
the norm? how can i solve this
I created a router where I output config information
I'm trying to change value from .env file, for example APP_NAME, from APP_NAME="Nuxt + Laravel" to APP_NAME="test" but the change is not displayed on the page!(of course I reloaded the page 😊)
I was trying to look through php artisan tinker
It works!
But my config remains the same. I can not solve this problem for a week now.
I cleared the cache!!! I tried php artisan cache:clear, php artisan config:clear (i tried all command for cache)
CACHE_DRIVER=file
I deleted files bootsprap/cache/*, storage/framework/cache/*.
I tried everything!!!
I have this project on the github: https://github.com/iliyaZelenko/laravel-nuxt.
Please help me, I want my project to be used by other people.

Laravel does not read env variables

Did anyone has issues with env variables? For some reason, helper env('VARIABLE') returns null every time I use it. It happened very unexpectedly and I dont really know the reason. Restarting the apache/IDE/computer does not work.
Run those of command
composer dump-autoload
php artisan cache:clear
php artisan config:clear
php artisan view:clear
Now try to read
$value = env('VARIABLE_NAME');
if not working till now then,
Try another syntax to read env variable.
$value=getenv('VARIABLE_NAME');
The solution is simple, but neither the IDE nor the debugger says anything about it. It just returns null. When you use php artisan config:cache, according to the documentation:
If you execute php artisan config:cachecommand during your deployment process, you should be sure that you are only calling the env() function from within your configuration files.
Obviously I have env variables outside the config files, so after caching I was not able to use it outside anymore. The php artisan config:clear puts it back to work.
What I've found more about the usage of env, that it should be used only within config files. You can access env variables from the rest of the project using other helper method config(). Be sure to assign it to another key in config file, e.g. 'key' => env('CACHE_DRIVER')
What is more, you have to remember to run php artisan config:cache each time you will change .env file. Laravel will not load the new values, until it's cached. If it's not cached, no need to do it.
please use this its work for me use git bash or cmd and past this command
$ rm bootstrap/cache/config.php
this command clear cache folder
Just run
php artisan config:clear
It solved my issue.
In my case, it's just because I'm using php artisan serve, just restart it, the server command may read the env and keep at the startup time.

Resources