1 | <?php |
||
8 | class Customers extends Model |
||
9 | { |
||
10 | use SoftDeletes; |
||
11 | |||
12 | protected $primaryKey = 'cust_id'; |
||
13 | protected $fillable = ['cust_id', 'parent_id', 'name', 'dba_name', 'address', 'city', 'state', 'zip', 'active']; |
||
14 | protected $hidden = ['created_at', 'deleted_at', 'updated_at']; |
||
15 | protected $appends = ['child_count']; |
||
16 | protected $casts = [ |
||
17 | 'deleted_at' => 'datetime:M d, Y', |
||
18 | ]; |
||
19 | |||
20 | 16 | public function CustomerSystems() |
|
24 | |||
25 | 18 | public function getChildCountAttribute() |
|
29 | } |
||
30 |
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.