I have installed Laravel 8 as a new project. When I run the project I get the "In order to use the Auth::routes() method, please install the laravel/ui package." But Laravel installation doc says that laravel ui is depreciated and that we should use Jetstream. So I installed Jetstream with the Livewire stack. Back to test the project and I get the same error msg.
I have run a composer dump-autoload.
What do I have to do to get a Laravel 8 project to run?
You will need to clear and recreate cache. Run the following php artisan commands:
php artisan cache:clear
php artisan config:cache
php artisan route:cache
I had this problem as well on many 'upgrades' from earlier versions of Laravel. I don't want to change the entire auth mechanism, as it works, so I will keep the code I have.
#Elisha Senoo's answer is correct, and solved it most of the time. However, if you find yourself unable to clear the cache (because it has the same error message on the artisan command), the solution is to manually clear the .php files within the bootstrap/cache folder and then php artisan config:cache.
Related
Installing Swagger for the First Time in laravel 8
composer require "darkaonline/l5-swagger"
composer require zircote/swagger-php
php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"
Getting Error like:
I'm guessing the URL you're hitting might be incorrect. Change it to just docs/api-docs instead of docs/api-docs.json. In addition, if you haven't ran the generate command already, you would have to do so to make it work.
php artisan l5-swagger:generate
This is consuming the last 2 days of my life. Locally everything is working fine but when my code is deployed to Heroku, Laravel can't find the index view. It's my understanding this is some caching issue, so I have tried most of Artisan's commands to clean the cache:
php artisan config:cache
php artisan route:cache
php artisan view:clear
php artisan clear-compiled
This is my route, I'm serving a SPA:
Route::get('/{any}', 'HomeController#main')->where('any', '.*');
And this is the stack trace on my view:
I have cleaned the bootstrap/cache folder and honestly I'm out of ideas. Does someone have a light on this one? Thanks
Please use the all around cache clearing command :
php artisan optimize:clear
I've found the solution to the same issue:
The issue itself seems to be caused by the official php buildpack, which does php artisan optimize at the end of the build process inside the build environment (aside from other things it clears and recreates the configuration cache). This causes the build directory /tmp/build_xxxxxxxx/ to be saved into the configuration cache.
The solution is to run php artisan config:clear, but it won't take effect on the already built and running app because of how heroku works: when you access their shell you perform operations on the filesystem that's generated from a project build and is destroyed as soon as you exit the shell. The operations you perform on files in that shell don't effect the running app instances. php artisan config:clear must be ran at the end of the build process.
One way to do this is the gerardbalaoro/laravel buildpack which allows adding custom hooks after the build process. Keep in mind that it also does php artisan views:clear after the build while the official php buildpack doesn't. Using it and adding LARAVEL_COMMANDS='php artisan config:clear' to heroku config solved the issue for me.
tl;dr:
heroku buildpacks:set gerardbalaoro/laravel
heroku config:set LARAVEL_COMMANDS='php artisan config:clear'
git commit --allow-empty -m 'force rebuild'
git push heroku master
I wanted to remove a package from laravel. I did composer remove vendor/package
It was all good on my dev, but when I deploy on production something went wrong and I cannot do anything now.
when I run
php artisan package:discover
I'm geting
In ProviderRepository.php line 208:
Class 'Laracasts\Flash\FlashServiceProvider' not found
I'm guessing I it is something to do with some kind of cache or maby config
but I cannot run this command,
php artisan config:clear
because I'm getting the same error message as above.
PS. I'm using Laravel 5.6
You may need clear the autoloader files if they get jammed up as it is looking at those cached files when php artisan config:clear runs, thus creating the jam.
Remove the following files and they will rebuild:
/bootstrap/cache/packages.php
/bootstrap/cache/services.php
I fixed my problem deleting a config file like so:
$rm bootstrap/cache/config.php
This file is basically a cache for config, if you want to have this file built for you just run a following artisan command:
$php artisan config:cache
I'm trying to use Laravel 5.5. I updated my php 7.0 to php 7.1. Even, I update my laravel installer package. But, when I try to do:
laravel new myProject
I get this error:
You made a reference to a non-existent script #php -r
"file_exists('.env') || copy('.env.example', '.env');" You made a
reference to a non-existent script #php artisan key:generate
Illuminate\Foundation\ComposerScripts::postAutoloadDump You made a
reference to a non-existent script #php artisan package:discover
I am using laravel valet and if I go to the browser, when I try myProject.dev is not working. I see this error:
Whoops, looks like something went wrong.
I tried using:
php artisan key:generate
inside my project, but I got that:
[ErrorException]
file_get_contents(/Users/jorgeJimenez/Sites/laravel5-5/.env): failed
to ope n stream
: No such file or directory
I noticed, my laravel 5.4 projects are working. I copied a .env file and I put on my laravel 5.5 projects. After that, I run
php artisan key:generate
and the key was generated and my project in the browser works.
It's supposed, all that process is automatic, but I am not quite sure what is happening.
You can try update your composer:
composer self-update
I had the same problem. Then I found that there was no problem when i created the first project use laravel 5.5. so I clear composer's cache dir. It works well now.
This is because of your Laravel Installer or Composer version. I have faced the same problem and found following 2 different solutions:
Generally you can solve with by running composer global update command and then run composer update command from your project directory. This solution basically updates your installer and then your project.
If still, you have this issue, you need to run composer self-update command first and then run composer update command from your project directory. Here your composer will update and then your project.
Hope this answer will help you.
I want to make use of auth system which comes with the laravel package but the problem is when I make new laravel package using composer i.e composer create-project laravel/laravel project name --prefer-dist
it do not install those auth resources which includes (i.e. auth folder inside resources > views) and also I can't find the Services Folder inside app directory.
All other things are working fine except this authentication system.
What can be the possible problems? Please give me solution
I am working with MAMP.
Taylor Otwell has made it opt-in for Laravel 5.1
You need to run following command after installation
php artisan scaffold:auth
UPDATE
I think this has been answered here
You could also run the command php artisan make:auth in the root directory of you laravel project. I had the same problem and it worked for me.
The command php artisan scaffold:auth didn't work for me i don't know why.
it issued the error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "auth" is not defined.
Did you mean this?
make:auth
in Laravel 5.2 you just have to run this command "php artisan make:auth" and the auth folder will be created
Since laravel 6.* version make:auth is no longer supported, use ui:auth instead.
For deploying ui pack run
composer require laravel/ui --dev
then update composer.json :
composer update -W
and do the:
php artisan ui:auth
You need execute
php artisan make:auth
now if your style css and js are missing
You need load file .css and .js
1) execute in your project
npm install
2) then execute
npm run dev => now in folder /public now exist folder js and css
3) reload page