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.
willaengine/app/Event.php

46 lines
1.0 KiB

<?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');
}
}