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.
46 lines
1.0 KiB
46 lines
1.0 KiB
5 years ago
|
<?php
|
||
|
|
||
|
namespace App;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use App\Appended\Traites\GetDateAttributesTrait;
|
||
|
|
||
|
|
||
|
class Event extends Model
|
||
|
{
|
||
|
// use GetDateAttributesTrait;
|
||
|
|
||
|
public $fillable = ['type', 'title_fa', 'body','business_id'];
|
||
|
|
||
|
public function banner()
|
||
|
{
|
||
|
return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner');
|
||
|
}
|
||
|
|
||
|
public function orginalTitleImage()
|
||
|
{
|
||
|
return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null);
|
||
|
}
|
||
|
|
||
|
public function title_image()
|
||
|
{
|
||
|
return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null);
|
||
|
}
|
||
|
|
||
|
public function images()
|
||
|
{
|
||
|
return $this->morphToMany('App\Gallery', 'uploadable');
|
||
|
}
|
||
|
|
||
|
public function tags()
|
||
|
{
|
||
|
return $this->morphToMany('App\Tag', 'taggable');
|
||
|
}
|
||
|
|
||
|
public function business()
|
||
|
{
|
||
|
return $this->belongsTo('App\Business');
|
||
|
}
|
||
|
|
||
|
}
|