DONE: layout letter with letterhead and footer, notification for newly...

This commit is contained in:
ISMAIL MASSERAN
2026-06-28 02:16:49 +00:00
parent 94ecbe5887
commit 034ecf947f
400 changed files with 29802 additions and 5446 deletions
+71
View File
@@ -0,0 +1,71 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Auth\Entities\User;
class Document extends Model
{
use HasUuids, SoftDeletes;
public const STORAGE_DISK = 'local';
protected $table = 'documents';
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'documentable_type',
'documentable_id',
'name',
'path',
'file_size',
'mime_type',
'type',
'description',
'uploaded_by',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'name' => 'string',
'path' => 'string',
'file_size' => 'integer',
'mime_type' => 'string',
'type' => 'string',
'description' => 'string',
];
}
public function documentable(): MorphTo
{
return $this->morphTo();
}
public function uploadedBy(): BelongsTo
{
return $this->belongsTo(User::class, 'uploaded_by');
}
}