简体   繁体   中英

Laravel 4 Package installation using composer

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.

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

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

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.

Ok, you can't execute composer commands on windows command prompt. mac/linux terminal would do but if you insist on using windows then install this [ https://www.cygwin.com/] so you could issue unix commands

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM