'array', 'image' => 'string' ]; protected static $logName = 'brand'; protected static $logAttributes = ['name']; protected static $submitEmptyLogs = false; protected static $logOnlyDirty = true; /** * @return int */ public function getID(): int { return (int) $this->id; } public function getName() { return $this->name[App::getLocale()] ?? null; } /** * @return string */ public function getImage(): string { if (!empty($this->image)) { if (in_array(config('filesystems.default'), ['s3', 'minio'])) { return Storage::url($this->image); } ; return (string) '/' . $this->image; } return (string) 'images/no_brend.png'; } public function categories() { return $this->belongsToMany(Category::class, 'categories_brands'); } }