PHP code example of rentalmanager / photos

1. Go to this page and download the library: Download rentalmanager/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/ */

    

rentalmanager / photos example snippets

 

$photo = new Photo([...]);
$photo->save();

$property->attachPhoto(1, 10); 

$property->detachPhoto(1);

// or
$property->detachPhotos([1,2,3]);

$photos = $object->getOrderedPhotos();

$object->syncPhotos($photos);

$url = 'https://media.equityapartments.com/images/c_crop,x_0,y_0,w_1920,h_1080/c_fill,w_1920,h_1080/q_80/4206-28/the-kelvin-apartments-exterior.jpg';

$photoElements = Photos::parseExternalPhoto($url);

dump( $photoElements);

$photo = Photo::find(1);

$photo = Photos::generateThumbnails($photo);

$photo = Photos::upload($path_to_image);

$photo = Photos::upload($path_to_image, false, true); // the last param is thumbnail generator

$photo = Photos::upload($path_to_image, 'store/there/instead');

$path = Photos::generatePath($id = false);
 bash
$ php artisan
 bash
$ php artisan vendor:publish --tag="photos"
 bash
$ php artisan rm:setup-photos