When I run composer update, I get the following error:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Illuminate\Foundation\ComposerScripts::postUpdate
php artisan optimize
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Laravel\Cashier\CashierServiceProvider' not found
Script php artisan optimize handling the post-update-cmd event returned with err
or code 255
I put this code on the app.php file
Laravel\Cashier\CashierServiceProvider::class,
and in the composer.json I also put this
"laravel/cashier": "~6.0"
like in the laravel doc
stack errot
Remove the
Laravel\Cashier\CashierServiceProvider::class,
from app.php.
It needs to be added after installing the package.
Also, instead of composer update, try composer require without changing the composer.json file.
composer require laravel/cashier
Don't add anything in composer.json file or app.php.
Just follow the documentation given in Laravel website for Laravel Cashier, (select the laravel version which you are using in your project).
Run the commands in following order:
//install the package and add it in composer file
composer require laravel/cashier
//add your cashier class in 'providers' array in app.php
Laravel\Cashier\CashierServiceProvider::class,
//add alias in 'aliases' array in app.php
'Cashier' => Laravel\Cashier\CashierServiceProvider::class,
//will add several columns to users table & create a new subscriptions table
php artisan migrate
Check the php version in cmd useing php -v
if php version is < 7.0 then install latest version of php.
Uninstall the old verion Xampp
Install latest version of Xampp to upgrade php.
Related
I'm trying to add the "cedarmaps-php-sdk" composer package to my Laravel project
the package can be found here: https://github.com/cedarstudios/cedarmaps-php-sdk
I have successfully installed the package using
composer install
&
composer update
The problem is when I want to use the 'CedarMaps' I get the error:
"main(): Failed opening required 'vendor/autoload.php' (include_path='C:\xampp\php\PEAR')" *image
for now, I'have manually bypassed this problem by changing
require('vendor/autoload.php');
to
require('../vendor/autoload.php');
in the below file (the repository file)
vendor/cedarmaps/cedarmaps-php-sdk/src/CedarMaps.php
am I doing anything wrong?
+++++++++++++++++++++++++++++++++
Let me ask a question: Was that necessary for this package to require autoload.php itself
, I mean doesn't composer handle this autoloading for all packages automatically?
You need to use composer require 'package name' to install a package to your existing project then do a composer dump-autoload.
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
i'm trying to install the anahkiasen/former package once again but it won't work. The funny thing is, I downloaded it about a weak ago and it was working perfectly. My code if finished and use's this former package. I tried to install a new package a half hour ago and since this the former class isn't found anymore.
Like I mentioned it, it was working perfectly before, but since I did a composer update it doesn't work.
Well I did what they said over here:
https://github.com/formers/former/wiki/Getting-started
first I run this::
composer require anahkiasen/former:4.0.*#dev
then a composer update
after the update I add this in my config/app.php provider section:
Former\FormerServiceProvider::class,
and this in the alias section:
'Former' => 'Former\Facades\Former',
I tried it but it still doesn't work. Just getting
Class 'Former\FormerServiceProvider' not found
as an output
I removed the package I wanted to install before and found another way.. But the problem with the former class is still there.
Thanks for any help!
Terminal outputs:
/var/www/laravel# php composer.phar require anahkiasen/former
gives:
Using version ^4.0 for anahkiasen/former
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
-------- then I added the provider/alias --- after this:
composer update --no-scripts
gives
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
composer dump-autoload
gives of course:
Generating autoload files
/var/www/laravel/logs# php artisan config:publish anahkiasen/former
gives:
PHP Fatal error: Class 'Former\FormerServiceProvider' not found in /var/www/laravel/logs/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Former\FormerServiceProvider' not found
note that I changed the directory in the last command
Let's start from the beginning.
Follow below steps:-
1) Run below command in terminal:-
composer.phar require anahkiasen/former
2) It'll ask you for the version, type dev-master
3) Add Former's service provider to your Laravel application in app/config/app.php. In the providers array add :
'Former\FormerServiceProvider',
Add then alias Former's main class by adding its facade to the aliases array in the same file :
'Former' => 'Former\Facades\Former',
4) run composer update --no-scripts
After that, run composer dump-autoload, and that should work.
If not working then run this command:-
php artisan config:publish anahkiasen/former
Hope it will help you :)
I installed emanuelzh/loptimizer for Laravel 5 (on Ubuntu). It is a fork from https://github.com/approached/laravel-image-optimizer
It is for image optimization.
I successfully installed it with composer:
composer.phar require emanuelzh/loptimizer
Using version ^1.0 for emanuelzh/loptimizer ./composer.json has been
updated php artisan clear-compiled Loading composer repositories with
package information Updating dependencies (including require-dev)
- Installing emanuelzh/loptimizer (1.0.0) Downloading: 100% Writing lock file Generating autoload files php artisan optimize
Generating optimized class loader
But the problem is with config/app.php file. I added the following line but it doesn't work when I try to publish.
config/app.php:
Emanuelzh\Loptimizer\ServiceProvider::class,
Publish command:
php artisan vendor:publish
Result of publish command:
Nothing to publish for tag [].
Do you know what is the correct line to add in config/app.php ?
Thanks for your help.
Remy
Ok. Finally I found the answer :)
The line to add in config/app.php is:
Approached\LaravelImageOptimizer\ServiceProvider::class,
and for the facade:
'ImageOptimizer' => Approached\LaravelImageOptimizer\ImageOptimizer::class,
Hope it helps!
I am new with laravel. I have no idea how to install aimeos in laravel 5.1, since the installation guide for laravel 5.0, there is a different service provider in between L5 and L5.1.
I got this error:
C:\xampp\htdocs\classic>composer require aimeos/aimeos-laravel
Using version ^1.0 for aimeos/aimeos-laravel
./composer.json has been updated
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Aimeos\Shop\ShopServiceProvider' not found
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
Please help me.
There's no difference between Laravel 5.0 and 5.1 when installing the Aimeos web shop package:
https://aimeos.org/docs/Laravel/Install_Aimeos
Update:
There seems to be a problem due to a recent change in Laravel 5.1.x because the service provider is now used before composer installs the package. I've fixed this in my test installation by
removing the the provider from config/app.php
removing the Aimeos related artisan commands in the "scripts" section of the composer.json file
running "composer update" afterwards with the aimeos-laravel package as requirement
executing the artisan tasks ("vendor:publish", "migrate", "aimeos:setup", "aimeos:cache") afterwards by hand
Download https://github.com/aimeos/aimeos-laravel.
place package to root or desired folder and while updating the composer set
"require": {
.......
"laravel/framework": "^5.1.11",
......
}
then brows
https://aimeos.org/docs/Laravel/Install_Aimeos#Laravel_5.0.2F5.1_and_Aimeos_1.0 Link and follow the instructions.