tarfin-labs /
parasut-laravel
| 1 | <?php |
||
| 2 | |||
| 3 | namespace TarfinLabs\Parasut\Models; |
||
| 4 | |||
| 5 | use Illuminate\Database\Eloquent\Model; |
||
| 6 | use Sushi\Sushi; |
||
| 7 | |||
| 8 | class BaseModel extends Model |
||
| 9 | { |
||
| 10 | use Sushi; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 11 | |||
| 12 | 10 | public function __construct(array $attributes = []) |
|
| 13 | { |
||
| 14 | 10 | parent::__construct($attributes); |
|
| 15 | |||
| 16 | 10 | $this->fillable = array_keys($this->schema); |
|
|
0 ignored issues
–
show
|
|||
| 17 | 10 | } |
|
| 18 | |||
| 19 | 10 | public function getRows(): array |
|
| 20 | { |
||
| 21 | 10 | return [array_merge(['id' => 'integer'], $this->schema)]; |
|
|
0 ignored issues
–
show
|
|||
| 22 | } |
||
| 23 | } |
||
| 24 |