1
0
Fork 0
BitHarbor/backend/app/Models/Brand.php
2026-04-07 23:19:15 +02:00

43 lines
838 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Brand extends Model
{
/** @use HasFactory<\Database\Factories\BrandFactory> */
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'slug',
'description',
'website_url',
'active',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'active' => 'boolean',
];
}
public function products(): HasMany
{
return $this->hasMany(Product::class);
}
}