composer require could find package - laravel

I am trying to install unideveloper/laravel-password in my laravel 5.8 project using:
composer require --dev "unicodeveloper/laravel-password": "1.0.*"
But, I get the following error:
[InvalidArgumentException]
Could not find package 1.0.*.
Did you mean one of these?
lastguest/ev
1032443065/pudge
appium/php-client
authbucket/oauth2
wicochandra/captcha
how to solve this please?

Instead of updating it into composer.json file ,
Install it directly using the following command .
composer require unicodeveloper/laravel-password
Which is worked for me .
If you are looking for particular version ,
Then you can install the particular version by using the command :
composer require unicodeveloper/laravel-password:1.0.*

That syntax is for composer.json file and is not correct for CLI command
composer require vendor/package:version
for example:
composer require --dev unicodeveloper/laravel-password:1.0.*
Hope this helps

Related

how to install illuminate/mail via composer in Lumen

A setting mail-in on lumen project, I should install illuminate\mail via composer, but show me an error:
Your requirements could not be resolved to an installable set of packages
You can install through composer using the following command in the terminal:
composer require illuminate/mail
Make sure you are in the project directory.

how to upgrade version of composer

I was trying to require a package using composer require command, and I faced following error
your version of
Composer is too old Please upgrade using https://getcomposer.org/
How can I update composer itself?
I am using Linux Mint 18.3.
Use this command to update the version of composer:
composer self-update
It's now new version of composer. So anyone want to upgrade the composer, should use this command:
composer self-update --2
The best way is using this command: composer self-update --stable
//To Update Composer try
composer self-update --2

composer.phar opens in notepad instead of running

I'm trying to install Symfony and some bundles in a new computer.
I initialize the project and create a database.
However, I also want to download DoctrineFixturesBundle and ´DoctrineMigrationsBundle`.
I'm using XAMPP, so I do:
C:\xampp\htdocs>composer.phar require doctrine/doctrine-fixtures-bundle
And then it opens "composer.phar" in a notepad...
You forgot that you need to call composer from php interpreter.
C:\whateverthepathis\php.exe C:\xampp\htdocs>composer.phar require doctrine/doctrine-fixtures-bundle
Or just install composer globally using its installer.
Install Composer with this command;
php -r "readfile('https://getcomposer.org/installer');" | php
and you can use php composer require doctrine/doctrine-fixtures-bundle

Laravel 4 - Require packages on Laravel install

I looked around for an answer to this question, but couldn't find anything.
Just wondering, is there a way to tell Composer to require additional packages during a laravel 4 installation?
For example:
If I want to always use the Entrust package in all my laravel projects, instead of having to require it every time I create a new laravel project, can I tell my Composer to also require the Entrust package when I run composer create-project laravel/laravel --prefer-dist
Thanks
I'm not aware of such thing in Composer, but you can add require statement to the same command:
composer create-project laravel/laravel --prefer-dist ./ && composer require zizaco/entrust

Swiftmailer Error Composer Install

i am installing composer dependencies by 'composer install'.
it download bunch of packages but after swiftmailer it gives me error
[UnexpectedValueException]
'C:\Users\DELL\Downloads\laravel-4\vendor/swiftmailer/swiftmailer/72e34d......54c82f.1' is not a zip archive.
what does it mean?
For me this problem happened due to the order composer was installing the files.
The work around that worked for me was to go into \vendor\composer\autoload_real.php and comment out the following line
require $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php';
and then run composer again
Running composer install with the --prefer-source option, fixed this problem for me.

Resources