1 | <?php |
||
8 | class Page extends HasContent |
||
9 | { |
||
10 | use Sluggable, SoftDeletes; |
||
11 | |||
12 | /** |
||
13 | * The table associated with the model. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $table = 'pages'; |
||
18 | |||
19 | /** |
||
20 | * The attributes that are mass assignable. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $fillable = [ |
||
25 | 'name', 'slug', 'visible', 'order', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Properties to always eager load. |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $with = ['blocks', 'images', 'links']; |
||
34 | |||
35 | /** |
||
36 | * The attributes that should be casted to native types. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $casts = [ |
||
41 | 'visible' => 'boolean', |
||
42 | ]; |
||
43 | |||
44 | /** |
||
45 | * Fields that are dates. |
||
46 | * |
||
47 | * @var array |
||
48 | */ |
||
49 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
||
50 | |||
51 | /** |
||
52 | * Get the route key for the model. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getRouteKeyName() |
||
60 | |||
61 | /** |
||
62 | * Return all visible pages. |
||
63 | * |
||
64 | * @param bool $order If true, order pages by 'order'. |
||
65 | * |
||
66 | * @return \Illuminate\Support\Collection |
||
67 | */ |
||
68 | public static function allVisible($order = true) |
||
74 | |||
75 | /** |
||
76 | * Return all hidden pages. |
||
77 | * |
||
78 | * @param bool $order If true, order pages by 'order'. |
||
79 | * |
||
80 | * @return \Illuminate\Support\Collection |
||
81 | */ |
||
82 | public static function allHidden($order = true) |
||
88 | |||
89 | /** |
||
90 | * Return all pages ordered by 'order'. |
||
91 | * |
||
92 | * @return \Illuminate\Support\Collection |
||
93 | */ |
||
94 | public static function allOrdered() |
||
100 | |||
101 | /** |
||
102 | * Get all pages with given block name. |
||
103 | * |
||
104 | * @param string $blockName Name of block. |
||
105 | * |
||
106 | * @return \Illuminate\Support\Collection |
||
107 | */ |
||
108 | public static function hasBlockNamed($blockName) |
||
112 | |||
113 | /** |
||
114 | * Get all pages with given image name. |
||
115 | * |
||
116 | * @param string $imageName Name of image. |
||
117 | * |
||
118 | * @return \Illuminate\Support\Collection |
||
119 | */ |
||
120 | public static function hasImageNamed($imageName) |
||
124 | |||
125 | /** |
||
126 | * Get all pages with given link name. |
||
127 | * |
||
128 | * @param string $linkName Name of link. |
||
129 | * |
||
130 | * @return \Illuminate\Support\Collection |
||
131 | */ |
||
132 | public static function hasLinkNamed($linkName) |
||
136 | |||
137 | /** |
||
138 | * Return the page id. |
||
139 | * |
||
140 | * @return int |
||
141 | */ |
||
142 | public function id() |
||
146 | |||
147 | /** |
||
148 | * Return the page name. |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | public function name() |
||
156 | |||
157 | /** |
||
158 | * Return the page slug. |
||
159 | * |
||
160 | * @return string |
||
161 | */ |
||
162 | public function slug() |
||
166 | |||
167 | /** |
||
168 | * Return the page order value. |
||
169 | * |
||
170 | * @return int |
||
171 | */ |
||
172 | public function order() |
||
176 | } |
||
177 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.