Laravel 4 Package installation using composer

14,036

Solution 1

Just using packagist, you can go to packagist.org , after that just put the package name at require key in your composer.json on your laravel project, and that run this command , composer update or compose install

in example :

// composer.json
"require": {
    // default value..
    "intervention/image": "dev-master",
}

i hope this help

Solution 2

Laravel 4 now uses composer to install packages.

You can add new packages to laravel via a few options on composer. One is on the command line.

> composer require author/package
> dev-master

After issuing the require command it will ask you what version to use. then run composer update, add the PackageServiceProvider to your app/config/app.php

Solution 3

First and always if you plan to use composer in your work, learn the basics of it (what is composer.json,composer.lock...) There is excellent video on Laracasts https://laracasts.com/lessons/you-must-use-composer That way you can avoid problems and enjoy using this great package manager.

Next use composer dump(-autoload) command frequently and composer self-update.

If that bundle is deprecated in Laravel4 than it is deprecated and you can't use it ( unless author made some changes and adopt it for l4 ) Also bundle is a l3 specific type and in l4 we have packages.

Share:
14,036

Related videos on Youtube

Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I need to know how to install packages in laravel 4.

    I have downloaded a bundle from github, but executing the bundle, I see it is deprecated in Laravel 4. Can anyone please help me.

  • J86
    J86 over 9 years
    That video cast is not free :(
  • J86
    J86 over 9 years
    Can you please elaborate for the absolute n00bs (on Windows)? Do I type the above in Windows Command Prompt? If yes, do I have to navigate anywhere first? Currently at C:\Windows\system32 any clarification would be appreciated.
  • Zac Grierson
    Zac Grierson about 9 years
    Might want to mention about dump-autoload
  • Kumar Sambhav Pandey
    Kumar Sambhav Pandey about 8 years
    Hi majidarif, Steps up to composer update is fine but how to add PackageServiceProvider to app/config/app.php ?