You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
583 B
35 lines
583 B
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Attribute extends Model
|
|
{
|
|
protected $fillable = ['name_front', 'name_back','type','has_tag', 'for_section', 'category_id'];
|
|
|
|
protected $hidden = ['pivot'];
|
|
|
|
|
|
public function values()
|
|
{
|
|
return $this->hasMany('App\AttributeValue');
|
|
}
|
|
|
|
public function category()
|
|
{
|
|
return $this->belongsTo('App\Category');
|
|
}
|
|
|
|
public function businesses()
|
|
{
|
|
return $this->belongsToMany('App\Business');
|
|
}
|
|
|
|
public function products()
|
|
{
|
|
return $this->belongsToMany('App\Product');
|
|
}
|
|
|
|
}
|