I've been trying to work on a laravel app but I can't even make it start.
I've run composer install, composer global update, composer udpate, composer self-update and several other commands,
I've deleted the vendor folder, the composer.lock file, re-ran composer install and things I've found online to no avail. This is the error I keep getting:
#php artisan package:discover
In Container.php line 779:
Class request does not exist
Script #php artisan package:discover handling the post-autoload-dump event returned with error code 1
Not sure where to go next. Any ideas?
I would suggest you remove your composer itself and re-install the composer. the try install you laravel packages with it.
Try clearing application cache using this command: php artisan cache:clear
The cache:clear command can be used to clear the applications cache files.
Don't worry about your laravel
check composer correctly installed on your system
check composer have access for READ and WRITE in your system
after your sure about things
check your laravel install in your system for PHP you have and find specific you php version composer connected to it (Those who have multi PHP)
then have two option:
composer global require laravel/installer
then laravel new blog or
composer create-project --prefer-dist laravel/laravel blog
then go to folder cd /projectName
Use PHP's built-in development server: php artisan serve
Related
In my Laravel 8 application, after installing laravel ui, when I try to run 'php artisan ui bootstrap' I get the following error:
In Bootstrap.php line 70:
copy(C:\xampp\htdocs\netlytics\resources\js/bootstrap.js): Failed to open stream: No such file or directory
I have run composer update successfully.
I have laravel/ui version 3.2.0. I am running Laravel 8.40.0 with PHP 8.0.3.
The site is an old site that I upgraded from Laravel 5.3 and PHP 5.6.
The pre-processing was being done using gulp with a gulpfile.js to configure the mix conversions.
With Laravel 8 I know I need to update my pre-processing to use webpack.mix.js, but so far can't get there.
There is supposed to be a resources/app/bootstrap.js file but it is not showing up and I do not know what it should look like if I wanted to put it there.
Any ideas how to get this installed correctly?
I poked around and finally discovered that I needed to install jQuery and jQuery-ui as well as popper.js. I installed those and again got the same error, but this time I just created a resources/app/bootstrap.js file and when I ran 'php artisan ui bootstrap' it ran and populated the bootstrap.js file.
Here solution:
https://stackoverflow.com/a/68393896/15391779
composer create-project laravel/laravel --prefer-dist laravel-bootstrap
composer require laravel/ui
php artisan ui bootstrap --auth
npm install
npm run dev
I am trying to use the Telescope package from Laravels official documentation and I followed the first 2 steps:
composer require laravel/telescope
and
php artisan telescope:install
Everything went fine in my command line untill the install. I got the error:
ErrorException : file_get_contents(path\app\Providers/TelescopeServiceProvider.php: failed to open stream: No such file or directory at: vendor\laravel\telescope\src\Console\InstallCommand.php
So, of course, I googled the issue and found this and I checked to see if my provider's folder exists. It does and indeed the TelescopeServiceProvider.php is not there. I tried to run the command php artisan telescope:install again and it provided me the message:
Telescope scaffolding installed successfully.
which I thought was strange but ok, I went to the next step of the documentation:
After installing the Telescope, you should also run the migrate command:
php artisan migrate
So I ran that command and I got the message:
Nothing to migrate.
So obviously this didn't go right. I checked after the "fake" installed successfully message if the TelescopeServiceProvider exists now but it still didn't.
What did I do wrong and how do I fix this issue?
Try update Telescope,
composer update --prefer-source
Try removing Telescope and then reinstalling the package as the installation seems to have broken the package:
composer remove laravel/telescope
composer require laravel/telescope
Try:
composer dump-autoload
or:
artisan cache:clear
after you update or make changes to composer.json to refresh everything.
Per
the Telescope Github Issues
Telescope is not ready for Laravel 6 yet. Many people are having this same issue. The solution is to look at this issue.
Although it is a workaround, not a solution.
use composer dump-autoload
and:
artisan cache:clear
but
install composer require brick/math
its work
I had installed PragmaRx\Tracker package several months ago into my project.
I started to deleting the package from laravel project through following steps:
1. composer remove vendor/PragmaRx/Tracker
2. remove package name form composer.json file
3. removing package from provider and aliases list in config/app.php file
4. composer dump-autoload
5. composer update
6. also php artisan dump-autoload
I also tried a bunch of other ways to remove the package.
after removing the package I'm getting this error when I run any artisan command (even "php artisan serve" command):
In ProviderRepository.php line 208:
Class 'PragmaRX\Tracker\Vendor\Laravel\ServiceProvider' not found
It's obvious that the package and its related files have been removed! but I couldn't find out the error's reason.
my laravel version is 5.5.4 .
any idea?
finally I found the error's reason.It's because of laravel cache!!
in one hand I couldn't run any artisan command including "php artisan config:cache" to clear laravel cache, in the other hand the cache was the error's reason.So at first I re-installed the pachage :
composer require PragmaRx/Tracker
then :
php artisan config:cache
and finally :
composer remove PragmaRx/Tracker
Done.
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