PHP code example of perrotin / smart-select
1. Go to this page and download the library: Download perrotin/smart-select 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/ */
perrotin / smart-select example snippets
namespace App\Models;
use SmartSelect\Contracts\HasDefaultSelectColumns;
use SmartSelect\Traits\HasDefaultSelect;
class User extends Model implements HasDefaultSelectColumns
{
use HasDefaultSelect;
protected $table = 'users';
public function getGrantColumns(): array
{
return [
'select' => ['id','name','created_at','updated_at'],
'insert' => ['email', 'name'] // $this->fillable
];
}
}