PHP code example of ssistemas / searchable

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

    

ssistemas / searchable example snippets


    class User extends Model
    {
        use Ssistemas\Searchable\Traits\Searchable;
        private $searchable = [
            'columns'=>['category.name'],
            'joins'=>[
                'customers' => ['category.id','user.category_id'],
            ],
        'orders'=>['category.name,asc'],
        ];
        ...
    }

    $users = User::search($value)->get();