Skip to Content
PHPCODE
Composer & Installing Laravel
laravel code / August 18, 2018

Composer & Installing In Laravel

composer one type of program autoloader dependencies manager and package manager

Composer installation and Dompdf used and command follow this

(1) Why autoloader in laravel
open the cmd and write mkdir and folder name composer

(1) mkdir composer
(2) rmdir remove folder
(3) mkdir composer
(4) composer init meand new package created
(5) vendor/package
(6) Description :-
(7) Author :- abc <abc@xyz.com>
(8) Minimum statbility []
(9) package Type []
(10) license []:
(11) Define your dependencies
(12) would you like …[yes] n
output :-
{
    “name”: “abc/xyz”,
    “authors”: [
        {
            “name”: “abc”,
            “email”: “abc@xyz.com”
        }
    ],
    “require”: {}
}
(13) Do you confirm generation [yes]? y
(14) Do you confirm generation [yes]? y
(15) composer update
-> atomatiocally vendor folder created vendor/composer….
(16) composer require dompdf/dompdf
(17) composer update

have to created composer.json file
server created in composer packages
https://packagist.org/

dompdf/dompdf html to pdf convert

step 1 :- created index.php
<?php
include_once __DIR__ .”/vendor/autoload.php”;
use DompdfDompdf;
$pdf=new Dompdf;
$pdf->loadHtml(‘<h1>Hello Word!</h1>’);
$pdf->render();
$pdf->stream();
?>

Laravel Installtion this command follow

remove folder rm -rf l5
step 1 open cmd and write this command latest date 18/8/2018 version 5.4.30
(1)window 7:- composer create-project laravel/laravel l5
(2)linux :- sudo composer create-project laravel/laravel l5

PHPCODE © 2024