Composer having trouble with installing fresh laravel libraries - laravel

I'm installing a new Laravel 5.6 ambient with composer, but every time i do a "Laravel new projectName", when i run composer install or composer update, it returns this error:
Could not scan for classes inside
"path/to/vendor/hamcrest/hamcrest-php/hamcrest" which does not appear
to be a file nor a folder
After hours of trying to fix it, I made a test, manually creating the hamcrest folder. When i ran composer install again, it pointed that composer couldn't read a file in the "psysh" library, when i went to check it, the folder was completely empty. I downloaded the files again and put them in the folder, just to test if it was going to run. After doing that and running composer install, this error popped out
Illuminate\Foundation\ComposerScripts::postAutoloadDump #php artisan
package:discover
In ProviderRepository.php line 208:
Class 'Laravel\Tinker\TinkerServiceProvider' not found
Script #php artisan package:discover handling the post-autoload-dump
event returned with error code 1
I don't know where i messed up, since this is a fresh install of composer + laravel. I ran composer diagnose, but everything is ok. Does anyone where is my error?

Laravel Tinker
composer require laravel/tinker
Once the package has been installed, you should add Laravel\Tinker\TinkerServiceProvider::class to the providers array in your config/app.php configuration file.
then in console, make a
composer dump-autoload

Related

Nothing to publish for tag [Charts_assets]

I installed everything using the steps that they provided.
I ran composer equire consoletvs/charts on the package . This installed into the vendor folder.
I then added the ConsoleTVs\Charts\ChartsServiceProvider::class,into the provider in config/app and 'charts'=>ConsoleTVs\Charts\Charts::class, as an aliases..
I ran artisan vendor:publish --tag=charts_config, the config file created successfully and I had no problems.
I ran php artisan vendor:publish --tag=charts_assets --force
But I kept on getting: Nothing to publish for tag [[charts_assets]]. which has lead me to thinking that this could be the problem since the package is not published.
any solution to solve this problem ?

package:discover error code 255 after pulling repo and composer update

I pulled a repo with a Laravel app and tried
composer update
but it exits with
Script #php artisan package:discover handling the post-autoload-dump event returned with error code 255
I found the following and regenerated the .env file and the key:
Script #php artisan package:discover handling the post-autoload-dump event returned with error code 255
It did not help anything. I also got the original .env file from the server which also did not help.
Any idea what the problem could be?
ok now it works. What I did:
1.Created a fresh project with
laravel new test
2.Copied the composer.json from the not working project to my fresh project
3.did run:
composer update
(which did not have any problems in that fresh project, who knows why..)
4.did overwrite the vendor folder inside the not working project with the vendor folder from the fresh project after running composer update (see 3.)
5.did run:
php artisan key:generate
6.did run:
php artisan serve
7.app is running without any errors.

Error removing UniSharp laravel-ckeditor with composer

I installed laravel-ckeditor via composer in my Laravel 5.5 project as described on their GitHub (https://github.com/UniSharp/laravel-ckeditor). Now i don't need it anymore and want to remove it. I executed composer remove unisharp/laravel-ckeditor but i get this error messge:
In ProviderRepository.php line 208:
Class 'Unisharp\Ckeditor\ServiceProvider' not found
I have on idea what causes this error. I tried reinstalling and removing it several times, but i always get the same error message.Thanks for any help.
Edit: The error is caused by artisan. I can't execute php artisan cache:clear anymore and directly before the error, composer prints
> #php artisan package:discover
into the console.

How to Uninstall Laravel?

I am facing fatal errors regarding Artisan. I think I couldn't install laravel complete due to slow internet. Now I want to remove Laravel from root and want to have fresh installation.
Can anyone help me?
if you have installed it globally you can simply remove it by composer global remove laravel/installer
If you have installed it via composer project you simply remove the directory.
Since I was looking all around how to uninstall packages and after reading tones
of documentations here's the short how-to uninstall a workbench package in Laravel
Remove package service provider from 'providers' array in app/config/app.php
Remove the package folder in workbench/
Run:
php composer.phar dump-autoload
php artisan clear-compiled
php artisan optimize
(optional) remove all related code using the package (you'll get errors about that)
or use composer global remove laravel/installer
For me, the command that actually did the trick was: composer global remove laravel/installer

how to make php artisan command available?

I read previous posts here about same problem but they did not solve my problem. I am running wamp latest version on windows 7 and I cloned a laravel app from github then I ran composer install on the root folder of the app and all vendors installed. however I still can not execute php artisan list on the app root folder
I tried also this command
composer global require "laravel/installer=~1.1"
but same problem also there is no laravel folder installed inside vendor folder. I dont know what laravel version used with this web app
So how I can make php artisan work ?
Update:
I opened composer.json file and I found no Laravel frame work to install !! should I return to the developer who made this or I just add Laravel package to composer.json and run composer install again ? if so what I should add to the composer.json ? I dont know which version to install !!
Your project has to have an artisan file in the root directory, otherwise the php artisan command won't work.
I had a similar issue. Fixed it by using the following command, which results in a clean installation.
composer create-project --prefer-dist laravel/laravel my-project
If errors occur, your CLI will show them.
Docs

Resources