PHP code example of ciebit / photos

1. Go to this page and download the library: Download ciebit/photos library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ciebit / photos example snippets


use Ciebit\Files\Images\Image;
use Ciebit\Files\Status as ImageStatus;
use Ciebit\Photos\Photo;
use Ciebit\Photos\Status;

$image = new Image(
    'Name Image',
    'image/jpeg',
    'uri-image.jpg',
    400, # width
    300, # height
    ImageStatus::ACTIVE()
);

$status = Status::ACTIVE();

$photo = new Photo($image, $status);
$photo
->setId('2')
->setViews(5)
->setPosition(1)
;