| 1 | <?php namespace GeneaLabs\LaravelModelCaching\Tests\Fixtures; |
||
| 11 | class Author extends Model |
||
| 12 | { |
||
| 13 | use Cachable; |
||
| 14 | use SoftDeletes; |
||
| 15 | |||
| 16 | protected $casts = [ |
||
| 17 | "finances" => "array", |
||
| 18 | ]; |
||
| 19 | protected $fillable = [ |
||
| 20 | 'name', |
||
| 21 | 'email', |
||
| 22 | "finances", |
||
| 23 | ]; |
||
| 24 | |||
| 25 | public function books() : HasMany |
||
| 29 | |||
| 30 | public function printers() : HasManyThrough |
||
| 34 | |||
| 35 | public function profile() : HasOne |
||
| 39 | |||
| 40 | public function getLatestBookAttribute() |
||
| 47 | |||
| 48 | public function scopeStartsWithA(Builder $query) : Builder |
||
| 52 | |||
| 53 | public function scopeNameStartsWith(Builder $query, string $startOfName) : Builder |
||
| 57 | |||
| 58 | public function scopeBooksStartWith(Builder $query, string $startOfName) : Builder |
||
| 62 | } |
||
| 63 |