Error: There are no commands defined in the "fos:user" namespace - php

I am trying to create a FOSUserBundle user using the command line tool:
php bin/console fos:user:create admin --super-admin
but I am systematically getting:
There are no commands defined in the "fos:user" namespace.
Any ideas? I can see CreateUserCommand.php in /vendor/friendsofsymfony/user-bundle/Command/
Update
I have tried to delete \vendor and to run composer install again, but to no avail.
My composer.json has "friendsofsymfony/user-bundle": "~2.0"
Finding
Apparently, it is a known issue: https://github.com/FriendsOfSymfony/FOSUserBundle/pull/2639#issuecomment-361059568

remove composer.lock file and then run
composer install again followed by
composer update or composer dump-autoload commands.

Related

I want to add a few dependencies in laravel project

I have a website in laravel but at the checkout time it's showing 500 error
I searched for solutions and someone told me to do add some code in composer dependies and update composer
But I'm unable to find in which file I have to add the code
Can you guys guide me
Here is the code
"barryvdh/laravel-dompdf": "^0.9.0"
https://github.com/barryvdh/laravel-dompdf/issues/747
All PHP Dependencies are mentioned in composer.json file which is located on root of the project.
Add "barryvdh/laravel-dompdf": "^0.9.0" this to your composer.json.
Open Your terminal.
cd your_project_path.
Run composer dump-autoload.
Or add dependency via composer
Open terminal.
cd your_project_path.
composer require barryvdh/laravel-dompdf.

Laravel 5.2: While moving to production, class "Collective\Html\HtmlServiceProvider" not found in vendor folder

I have been trying to move my laravel app to production. I following below steps
1. git clone
2. composer install
3. set env variables
4. (artisan key:generate)
5. artisan migrate --seed
But when i ran composer install, am getting the following error
Class 'Collective\Html\HtmlServiceProvider' not found in vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
I know this error means, laravelcollective not added in composer.json and need to following steps as mentioned here
But i already have done the same thing in dev mode and now the composer.json has require "laravelcollective" and aliases in config/app.php.
My question is, do i need to the same thing what i have done in dev (resolving laravelcollective issue) for every new production instance that i am gonna set it up ?
if your project working fine locally, then you have to Run composer update commend under your project repo. did you uploaded vender folder?
Also try to upload(only) vender/composer folder into your vender, and then try to runcomposer installorupdate` command
update it in your composer.json file.
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"laravelcollective/html": "5.1.*"
},
then in run command 'composer update' after it add dependancy in you app/config/app.php file..
Try:
composer install --no-scripts
this should install all the dependencies without problem

Class 'Jenssegers\Mongodb\MongodbServiceProvider' not found

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

Class not found in ProviderRepository.php error with composer install

I'm currently in the process of trying to include this package in my Laravel app: https://github.com/tappleby/laravel-auth-token
I included "tappleby/laravel-auth-token": "0.3.*" in composer.json, like this:
"require": {
"laravel/framework": "4.2.*",
"intervention/image": "dev-master",
"laracasts/flash": "~1.0",
"laracasts/validation": "1.1.*",
"tappleby/laravel-auth-token": "0.3.*"
}
And I added 'Tappleby\AuthToken\AuthTokenServiceProvider' and 'AuthToken'=>'Tappleby\Support\Facades\AuthToken','AuthTokenNotAuthorizedException' =>'Tappleby\AuthToken\Exceptions\NotAuthorizedException' to app/config/app.php.
Afterwards I ran composer install. This is the way I always added packages, but now I get an error every time: [RuntimeException]
Error Output: PHP Fatal error: Class 'Tappleby\AuthToken\AuthTokenServiceProvider' not found in /var/www/example.com/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
Goto bootstrap/cache folder and delete config.php
Then run
composer dump-autoload
As Marcin said you shouldn't use
composer install
but
composer update
Second thing remove all the lines added to app/config/app.php
First run composer update after that put those lines in app/config/app.php
Then run php artisan config:publish tappleby/laravel-auth-token in your command line
It should publish your configuration and now you should be able to use the relevant classes
Order is mandatory, run composer update then add the service provider and aliases to app.php
php artisan optimize:clear
composer install
If that don't work
remove composer.lock
remove vendor folder
composer install
You should run:
composer update
and not
composer install
When adding new dependency you should always use composer update to update your project and not composer install
Your config file may be cached. Remove all files from bootstrap/cache/*
after that run
composer install --optimize-autoloader --no-dev
php artisan config:cache

Install dependency (doctrine/dbal) on composer laravel

I am trying to execute a migration to rename some columns and I got an exception.
As I read on the documentation I have to add the doctrine/dbal dependency to my composer.json file. How do I do that? Which is the correct composer.json file. I have many in my application. Is the one that is on the same level as the folders app,bootstrap, public and vendor.
If so how do I add that dependency. Do I have to download anything?
By the way im using easyphp, not wamp!
Edit 1
After doing that the console throws this error
1) To install dependency , run this command
composer require doctrine/dbal
2) For 'git' is not recognized error, either you don't have git installed or the PATH is not added in the environment variables.
Install git for windows.
To add this dependency open the composer.json at the root of your project (in the same level as app, public etc.) and in the require section add the doctrine/dbal package like:
"require": {
"laravel/framework": "4.1.*",
"doctrine/dbal": "v2.4.2"
},
Save the file and run composer update
Edit
You probably installed git with the default settings and it's not in your PATH env.
Open Git Bash (it was installed with git - you will find it in your programs) and do composer update. By the way it's far better that windows command prompt.
If you are getting error while running migration try this
composer require doctrine/dbal:2.*

Categories