2026-02-16 09:29:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2026-02-21 16:16:58 +03:30
|
|
|
use App\Models\Setting;
|
2026-02-16 09:29:37 +00:00
|
|
|
|
|
|
|
|
class File extends Model
|
|
|
|
|
{
|
|
|
|
|
use HasFactory;
|
|
|
|
|
use Selector;
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'original_name',
|
|
|
|
|
'title',
|
|
|
|
|
'ext',
|
|
|
|
|
'src',
|
|
|
|
|
'size',
|
|
|
|
|
'user_id',
|
|
|
|
|
'type',
|
|
|
|
|
'has_thumb',
|
|
|
|
|
'url',
|
|
|
|
|
];
|
|
|
|
|
protected $casts = [
|
|
|
|
|
"has_thumb"=>"boolean"
|
|
|
|
|
];
|
|
|
|
|
public function getSrcAttribute(){
|
2026-02-21 16:16:58 +03:30
|
|
|
return env('domain').$this->attributes['src'];
|
2026-02-16 09:29:37 +00:00
|
|
|
// return url($this->attributes['src']);
|
|
|
|
|
}
|
|
|
|
|
}
|