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