$this->id, 'name' => $this->name, 'type' => 'brand' ]; } public function shouldBeSearchable() { return $this->status; } /** * Get image url for the category image. */ public function image_url() { if (! $this->image) { return; } return Storage::url($this->image); } /** * Get image url for the category image. */ public function getImageUrlAttribute() { return $this->image_url(); } /** * The products that belong to the brand. */ public function products(): HasMany { return $this->hasMany(ProductProxy::modelClass(), 'brand_id'); } public function flats():HasMany{ return $this->hasMany(ProductFlatProxy::modelClass(), 'brand_id'); } public function sellers():BelongsToMany { return $this->belongsToMany(SellerProxy::modelClass(), 'seller_brands'); } public function categories():BelongsToMany { return $this->belongsToMany(CategoryProxy::modelClass(), 'category_brands'); } }