2023-02-22 11:51:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
2023-02-23 16:23:00 +01:00
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
2023-02-22 11:51:36 +01:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @property integer $id
|
2023-09-06 16:05:17 +02:00
|
|
|
* @property string $name
|
2023-02-22 11:51:36 +01:00
|
|
|
* @property string $filter
|
2023-02-23 16:23:00 +01:00
|
|
|
* @property string $created_at
|
|
|
|
|
* @property string $updated_at
|
2023-02-22 11:51:36 +01:00
|
|
|
* @property Promo[] $promos
|
2023-02-23 16:23:00 +01:00
|
|
|
* @property Promo[] $promo
|
|
|
|
|
* @property Product[] $products
|
2023-02-22 11:51:36 +01:00
|
|
|
*/
|
|
|
|
|
class Brand extends Model
|
|
|
|
|
{
|
2023-02-23 16:23:00 +01:00
|
|
|
use HasFactory;
|
|
|
|
|
|
2023-02-22 11:51:36 +01:00
|
|
|
/**
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $fillable = [
|
2023-06-21 10:24:56 +00:00
|
|
|
'name',
|
2023-02-23 16:23:00 +01:00
|
|
|
'filter',
|
|
|
|
|
'created_at',
|
|
|
|
|
'updated_at'
|
2023-02-22 11:51:36 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
2023-02-23 16:23:00 +01:00
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
2023-02-22 11:51:36 +01:00
|
|
|
*/
|
|
|
|
|
public function promos()
|
2023-02-23 16:23:00 +01:00
|
|
|
{
|
|
|
|
|
return $this->belongsToMany('App\Models\Promo', 'promo_brands');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
|
*/
|
|
|
|
|
public function promo()
|
2023-02-22 11:51:36 +01:00
|
|
|
{
|
|
|
|
|
return $this->hasMany('App\Models\Promo');
|
|
|
|
|
}
|
2023-02-23 16:23:00 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
|
*/
|
|
|
|
|
public function products()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany('App\Models\Product');
|
|
|
|
|
}
|
2023-02-22 11:51:36 +01:00
|
|
|
}
|