1 | <?php namespace Arcanesoft\Seo\Models; |
||
18 | class Page extends AbstractModel |
||
19 | { |
||
20 | /* ----------------------------------------------------------------- |
||
21 | | Traits |
||
22 | | ----------------------------------------------------------------- |
||
23 | */ |
||
24 | use Presenters\PagePresenter; |
||
25 | |||
26 | /* ----------------------------------------------------------------- |
||
27 | | Properties |
||
28 | | ----------------------------------------------------------------- |
||
29 | */ |
||
30 | /** |
||
31 | * The attributes that are mass assignable. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $fillable = ['name', 'content', 'locale']; |
||
36 | |||
37 | /** |
||
38 | * The attributes that should be cast to native types. |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $casts = [ |
||
43 | 'id' => 'integer', |
||
44 | ]; |
||
45 | |||
46 | /* ----------------------------------------------------------------- |
||
47 | | Constructor |
||
48 | | ----------------------------------------------------------------- |
||
49 | */ |
||
50 | /** |
||
51 | * Page constructor. |
||
52 | * |
||
53 | * @param array $attributes |
||
54 | */ |
||
55 | public function __construct(array $attributes = []) |
||
62 | |||
63 | /* ----------------------------------------------------------------- |
||
64 | | Relationships |
||
65 | | ----------------------------------------------------------------- |
||
66 | */ |
||
67 | /** |
||
68 | * Footer's relationship. |
||
69 | * |
||
70 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
71 | */ |
||
72 | public function footers() |
||
76 | |||
77 | /* ----------------------------------------------------------------- |
||
78 | | Main Methods |
||
79 | | ----------------------------------------------------------------- |
||
80 | */ |
||
81 | /** |
||
82 | * Create a new page. |
||
83 | * |
||
84 | * @param array $attributes |
||
85 | * |
||
86 | * @return self |
||
87 | */ |
||
88 | public static function createOne(array $attributes) |
||
95 | |||
96 | /** |
||
97 | * Update a page. |
||
98 | * |
||
99 | * @param array $attributes |
||
100 | * |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function updateOne(array $attributes) |
||
107 | |||
108 | /* ----------------------------------------------------------------- |
||
109 | | Check Methods |
||
110 | | ----------------------------------------------------------------- |
||
111 | */ |
||
112 | /** |
||
113 | * Check if the page is deletable. |
||
114 | * |
||
115 | * @return bool |
||
116 | */ |
||
117 | public function isDeletable() |
||
121 | |||
122 | /* ----------------------------------------------------------------- |
||
123 | | Other Methods |
||
124 | | ----------------------------------------------------------------- |
||
125 | */ |
||
126 | /** |
||
127 | * Get the select input data. |
||
128 | * |
||
129 | * @return \Illuminate\Database\Eloquent\Collection |
||
130 | */ |
||
131 | public static function getSelectInputData() |
||
137 | |||
138 | /** |
||
139 | * Get the show url (Seoable). |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | public function getShowUrl() |
||
147 | |||
148 | /** |
||
149 | * Get the edit url (Seoable). |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getEditUrl() |
||
157 | } |
||
158 |