|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace CSlant\Blog\Core\Models; |
|
4
|
|
|
|
|
5
|
|
|
use AllowDynamicProperties; |
|
6
|
|
|
use CSlant\Blog\Core\Models\Base\BasePage; |
|
7
|
|
|
use Illuminate\Database\Eloquent\Builder; |
|
8
|
|
|
use Illuminate\Database\Eloquent\Relations\HasOne; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class Page |
|
12
|
|
|
* |
|
13
|
|
|
* @package CSlant\Blog\Core\Models |
|
14
|
|
|
* |
|
15
|
|
|
* @property int $id |
|
16
|
|
|
* @property string $name |
|
17
|
|
|
* @property string $description |
|
18
|
|
|
* @property string $content |
|
19
|
|
|
* @property string $status |
|
20
|
|
|
* @property string $template |
|
21
|
|
|
* @property string $image |
|
22
|
|
|
* @property int $user_id |
|
23
|
|
|
* |
|
24
|
|
|
* @method static Builder|Page newModelQuery() |
|
25
|
|
|
* @method static Builder|Page newQuery() |
|
26
|
|
|
* @method static Builder|Page query() |
|
27
|
|
|
* @method static Builder|Page first() |
|
28
|
|
|
* @method static Builder|Page find($id) |
|
29
|
|
|
* @method static Builder|Page with($relations) |
|
30
|
|
|
* @method static Builder|Page whereId($value) |
|
31
|
|
|
* @method static Builder|Page whereIn($column, $values) |
|
32
|
|
|
* @method static Builder|Page where($column, $operator = null, $value = null, $boolean = 'and') |
|
33
|
|
|
* @method static Page findOrFail($id) |
|
34
|
|
|
* @method static Page create($data) |
|
35
|
|
|
* |
|
36
|
|
|
* @mixin BasePage |
|
37
|
|
|
*/ |
|
38
|
|
|
#[AllowDynamicProperties] |
|
39
|
|
|
class Page extends BasePage |
|
40
|
|
|
{ |
|
41
|
|
|
/** |
|
42
|
|
|
* @return HasOne<Slug> |
|
43
|
|
|
*/ |
|
44
|
|
|
public function slug(): HasOne |
|
45
|
|
|
{ |
|
46
|
|
|
return $this->hasOne(Slug::class, 'reference_id', 'id') |
|
47
|
|
|
->where('reference_type', $this->getBaseModel()); |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|