pai-sklep/app/Models/Image.php
2021-12-08 21:45:36 +01:00

25 lines
449 B
PHP

<?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()
{
return Storage::url($this->path);
}
public function imageable() {
$this->morphTo();
}
}