PHP code example of web-id / flan

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

    

web-id / flan example snippets


return [
    'name' => 'myfilter',
    'filters' => [
        [
            'text' => 'Model ID',
            'name' => 'id',
            'active' => true,
            'field' => [
                'type' => 'number',
            ],
        ],
        // [ ... ]
    ],
];

'options' => [
    [
        'value' => '0',
        'text' => 'Disabled',
    ],
    [
        'value' => '1',
        'text' => 'Enabled',
    ],
    // [ ... ],
],

$this->setDefinition('number_of_pages', [
    'custom_select' => 'CONCAT(`number_of_pages`, " pages")',
]);

$this->setDefinition('author_birth_city', [
    'join' => 'leftJoinAuthorsTable',
    'custom_select' => '`authors`.`birth_city`',
]);

protected function leftJoinAuthorsTable(): void
{
    $this->query->leftJoin(
        'authors',
        'books.author_id',
        '=',
        'authors.id'
    );
}
shell
php artisan vendor:publish --provider="WebId\Flan\FlanServiceProvider"
shell
php artisan migrate