/
home
/
henzagold
/
server
/
app
/
Models
/
File Upload :
llllll
Current File: //home/henzagold/server/app/Models/Image.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Image extends Model { use HasFactory; public static $SELECT_FULL = 'image as full'; //protected $connection = 'pgsql'; protected $table = 'image'; protected $fillable=[ 'title', 'position', 'image', 'resize', 'resize_path', 'resize_watermark', 'resize_watermark_path', 'resize_small', 'resize_small_path', 'link', 'width', 'height', 'banner', 'original_name', 'ext', 'body',//توضیحات عکس ]; public function getFullAttribute($value) { if (is_null($value)) return; return 'https://henzagold.com/oapi/storage/' . $value; } public function product() { $this->hasOne('App\Models\Product', 'indicator_id_id'); } public function productImage() { $this->hasMany('App\Models\ProductImage', 'image_id'); } public function pi() { $this->belongsTo('App\Models\ProductImage', 'image_id'); } public function getImageAttribute($value) { //$url=env('BASE_PATH_STORAGE',''); //'https://henzagold.com/oapi/storage/' $url=Utility::baseURLStorage(); return $url.$value; } }
Copyright ©2k19 -
Hexid
|
Tex7ure