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.
27 lines
576 B
27 lines
576 B
5 years ago
|
<?php
|
||
|
|
||
|
namespace App;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
||
|
class Uploadable extends Model
|
||
|
{
|
||
|
|
||
|
protected $fillable = ['uploadable_id', 'uploadable_type', 'gallery_id', 'image_role','test'];
|
||
|
public $timestamps = false;
|
||
|
|
||
|
public function orginalGallery()
|
||
|
{
|
||
|
return $this->belongsTo('App\Gallery')->where('parent_id' , null);
|
||
|
}
|
||
|
public function ThumbGallery()
|
||
|
{
|
||
|
return $this->belongsTo('App\Gallery')->where('parent_id' , '!=' , null);
|
||
|
}
|
||
|
public function gallery()
|
||
|
{
|
||
|
return $this->belongsTo('App\Gallery');
|
||
|
}
|
||
|
|
||
|
}
|