PHP code example of rentalmanager / amenities

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

 
$object->attachAmenity(1);

$object->attachAmenities([1,2,3]);

$object->syncAmenities([1,2,3]);

$object->syncAmenitiesWithoutDetaching([1,2,3]);

// get all objects where amenities are
$result = $object->whereAmenitiesAre([1,2,3]);

$amenities = Amenity::byGroup('notable');

$amenities = Amenity::byType('unit');

// disctinct by groups
$groups = Amenity::groups();

$types = Amenity::types();
 bash
$ php artisan
 bash
$ php artisan vendor:publish --tag="amenities"
 bash
$ php artisan rm:setup-amenities
 php
$this->call(RentalManagerAmenitiesSeeder::class);
 bash
$ php artisan db:seed --class=RentalManagerAmenitiesSeeder