Quantcast
Channel: Netboy » php
Viewing all articles
Browse latest Browse all 5

How to work with a non-Composer 3rd party library in Laravel

$
0
0

Below are steps that have been working for me when using 3rd party libraries in a Laravel 4 project.

The first step is to add a repository to composer.json:

"repositories": [
  {
    "type": "package",
    "package": {
      "name": "netboy/Image_Iptc",
      "version": "master",
      "source": {
        "url": "https://github.com/netboy/Image_Iptc.git",
        "type": "git",
        "reference": "master"
      }
    }
  }
],

This will allow us to require the library in composer.json:

"require": {
  ...
  "netboy/Image_Iptc": "dev-master"
},

Finally we should add the lib to the autoload section:

"autoload": {
  "classmap": [
    ...
    "vendor/netboy/Image_Iptc/Iptc.php"
  ]
},

And update dependencies:

composer update

Viewing all articles
Browse latest Browse all 5

Trending Articles