Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How composer works?

Tags:

I haven't any idea about how composer works and add directory in our folder structure.

Recently I want to add repository to my laravel installation so for that i have used https://github.com/prettus/l5-repository, this repo and as per its installation steps, the first step is to execute following command :

composer require prettus/l5-repository

this command creates prettus directory under vendor so how this works and manage all things?

My questions are:

  1. what is the main purpose of composer?

  2. what is best structure for that?

  3. how it will handle depencdency?

  4. what is the "autoload" and 'psr-4` and use of both?

  5. correct path and structure for namesapcing 'autoload' and 'psr-4'?