I'm trying to use the following library, this.
It all seems pretty use but doesn't seem to work for me. I've added the stuff the the composer.json and I also updated the app.php. Then I ran composer dump-autoload in the laravel directory.
I still seem to be getting the same error..
FatalErrorException in ProviderRepository.php line 146:
Class 'Invisnik\LaravelSteamAuth\SteamServiceProvider' not found
Try to install this package by this command:
composer require invisnik/laravel-steam-auth
You will install the latest version of current package and update your composer.json, composer.lock and autoload files.
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.
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.
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'm using LaravelStapler package to manage image in Laravel 5.1.
I installed LaravelStapler with the following steps:
Add "codesleeve/laravel-stapler": "^1.0" into composer.json file
Add 'Codesleeve\LaravelStapler\Providers\L5ServiceProvider' into providers array in config/app.php file
Run composer install
And faced the error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Codesleeve\LaravelStapler\Providers\L5ServiceProvider' not found
If i run composer install before add 'Codesleeve\LaravelStapler\Providers\L5ServiceProvider' into providers array in config/app.php file, no error occurs.
It's hard for me to deploy into productions when I need to comment out 'Codesleeve\LaravelStapler\Providers\L5ServiceProvider' before composer install and uncomment after in production.
Are there any solutions which I can install it without commenting out 'Codesleeve\LaravelStapler\Providers\L5ServiceProvider' ?
Thanks in advance !
Update:
Sorry, It's my mistake. My team mate ignored composer.lock in Repository. I reviewed his pull-request and didn't realize that. Everything works as normal.
I want to use https://github.com/jenssegers/laravel-mongodb for connecting to Mongodb with laravel 5, i have installed MongoDB php driver and then laravel-mongodb with command composer require jenssegers/mongodb, then added service provider in app/config/app.php:
'Jenssegers\Mongodb\MongodbServiceProvider',
and refreshed my website, unfortunately i got error ->
FatalErrorException in compiled.php line 6466:
Class 'Jenssegers\Mongodb\MongodbServiceProvider' not found
how can i fix it?
run composer dump-autoload or php artisan optimize
I didn't have the archive:
myproject/vendor/jenssegers.
I installed this archive by command:
$ composer require jenssegers/mongodb
Delete Following Files and Use This Step :
composer.lock
bootstrap/cache/config.php
if exist
bootstrap/cache/services.php
then Run this command :
composer install
php artisan config:cache
If the previously mentioned solutions won't do the trick, it is possible that some dependencies are missing. Simply try:
$ composer install