2021-11-14 14:51:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
|
|
|
|
class Image extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
use HasUUID;
|
|
|
|
public $primaryKey = "uuid";
|
|
|
|
|
|
|
|
protected $fillable = [];
|
|
|
|
|
|
|
|
public function URL()
|
|
|
|
{
|
2021-11-14 20:44:10 +01:00
|
|
|
return Storage::url($this->path);
|
2021-11-14 14:51:49 +01:00
|
|
|
}
|
2021-12-08 21:29:28 +01:00
|
|
|
|
|
|
|
public function imageable() {
|
|
|
|
$this->morphTo();
|
|
|
|
}
|
2021-11-14 14:51:49 +01:00
|
|
|
}
|