1 | <?php namespace Arcanesoft\Seo\Models; |
||
18 | class Page extends AbstractModel |
||
19 | { |
||
20 | /* ----------------------------------------------------------------- |
||
21 | | Traits |
||
22 | | ----------------------------------------------------------------- |
||
23 | */ |
||
24 | |||
25 | use Presenters\PagePresenter; |
||
26 | |||
27 | /* ----------------------------------------------------------------- |
||
28 | | Properties |
||
29 | | ----------------------------------------------------------------- |
||
30 | */ |
||
31 | |||
32 | /** |
||
33 | * The attributes that are mass assignable. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $fillable = ['name', 'content', 'locale']; |
||
38 | |||
39 | /** |
||
40 | * The attributes that should be cast to native types. |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $casts = [ |
||
45 | 'id' => 'integer', |
||
46 | ]; |
||
47 | |||
48 | /* ----------------------------------------------------------------- |
||
49 | | Constructor |
||
50 | | ----------------------------------------------------------------- |
||
51 | */ |
||
52 | |||
53 | /** |
||
54 | * Page constructor. |
||
55 | * |
||
56 | * @param array $attributes |
||
57 | */ |
||
58 | public function __construct(array $attributes = []) |
||
65 | |||
66 | /* ----------------------------------------------------------------- |
||
67 | | Relationships |
||
68 | | ----------------------------------------------------------------- |
||
69 | */ |
||
70 | |||
71 | /** |
||
72 | * Footer's relationship. |
||
73 | * |
||
74 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
75 | */ |
||
76 | public function footers() |
||
80 | |||
81 | /* ----------------------------------------------------------------- |
||
82 | | Main Methods |
||
83 | | ----------------------------------------------------------------- |
||
84 | */ |
||
85 | |||
86 | /** |
||
87 | * Create a new page. |
||
88 | * |
||
89 | * @param array $attributes |
||
90 | * |
||
91 | * @return self |
||
92 | */ |
||
93 | public static function createOne(array $attributes) |
||
100 | |||
101 | /** |
||
102 | * Update a page. |
||
103 | * |
||
104 | * @param array $attributes |
||
105 | * |
||
106 | * @return bool |
||
107 | */ |
||
108 | public function updateOne(array $attributes) |
||
112 | |||
113 | /* ----------------------------------------------------------------- |
||
114 | | Check Methods |
||
115 | | ----------------------------------------------------------------- |
||
116 | */ |
||
117 | |||
118 | /** |
||
119 | * Check if the page is deletable. |
||
120 | * |
||
121 | * @return bool |
||
122 | */ |
||
123 | public function isDeletable() |
||
127 | |||
128 | /* ----------------------------------------------------------------- |
||
129 | | Other Methods |
||
130 | | ----------------------------------------------------------------- |
||
131 | */ |
||
132 | |||
133 | /** |
||
134 | * Get the select input data. |
||
135 | * |
||
136 | * @return \Illuminate\Support\Collection |
||
137 | */ |
||
138 | public static function getSelectData() |
||
144 | |||
145 | /** |
||
146 | * Get the show url (Seoable). |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | public function getShowUrl() |
||
154 | |||
155 | /** |
||
156 | * Get the edit url (Seoable). |
||
157 | * |
||
158 | * @return string |
||
159 | */ |
||
160 | public function getEditUrl() |
||
164 | } |
||
165 |