PHP code example of infancyit / igloo

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

    

infancyit / igloo example snippets


   protected $middleware = [
           ... ... ... ... ...
           ... ... ... ... ...
        
           \Barryvdh\Cors\HandleCors::class,
       ];
   
shell
    php artisan vendor:publish --provider="InfancyIt\Igloo\IglooServiceProvider"
    
Kernel.php
shell
php artisan make-model Book
shell
php artisan make-model Book --fillable=name,author,published_date
shell
php artisan make-model Book --guarded=id
shell
php artisan make-model Book --fillable=name,author,published_date --guarded=id
shell
php artisan make-service Book
shell
php artisan make-repository Book

public function getTransformableFields($entity)
    {
        return [
            'id'                   => (int) $entity->id,
            'name'                 => $entity->name,
            'author'               => $entity->author,
            'published_date'       => $entity->published_date
        ];
    }

public function rules()
    {
        return [
            'name'                   => '  => '
shell
php artisan make-route Book