$items * @property-read int|null $items_count * @method static \Illuminate\Database\Eloquent\Builder|MallCategory newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|MallCategory newQuery() * @method static \Illuminate\Database\Eloquent\Builder|MallCategory query() * @method static \Illuminate\Database\Eloquent\Builder|MallCategory whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|MallCategory whereName($value) * @mixin \Eloquent */ class MallCategory extends Model { /** * Indicates if the model should be timestamped. * * @var bool */ public $timestamps = false; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ ]; /** * Get the items in this category */ public function items(): HasMany { return $this->hasMany(MallItem::class, 'category_id', 'id'); } }