','css/nav', 'css/layout'])%>
nishi it

Play with composer

@code4mk 2017-07-31
Image
 
  • Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you .

Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with “packages” or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default it does not install anything globally. Thus, it is a dependency manager. It does however support a “global” project for convenience via the global command.

Composer inspired by npm and bundler

When you command your cli , composer check compoer.json and composer.lock then star installing package .

  • composer.json file as like this.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    {
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.4.*",
    "laravel/tinker": "~1.0"
    },
    "require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~5.7"
    },
    "autoload": {
    "classmap": [
    "database/seeds",
    "database/factories"
    ],
    "psr-4": {
    "App\\": "app/"
    }
    },
    "autoload-dev": {
    "psr-4": {
    "Tests\\": "tests/"
    }
    },
    "scripts": {
    "post-root-package-install": [
    "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
    "php artisan key:generate"
    ],
    "post-install-cmd": [
    "Illuminate\\Foundation\\ComposerScripts::postInstall",
    "php artisan optimize"
    ],
    "post-update-cmd": [
    "Illuminate\\Foundation\\ComposerScripts::postUpdate",
    "php artisan optimize"
    ]
    },
    "config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
    }
    }

composer is also a version management system .

Download composer