File manager - Edit - /var/www/html/portal/app/Models/Accounts/LinhasDoTempo/Attachment.php
Back
<?php namespace App\Models\Accounts\LinhasDoTempo; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Str; use DateTimeInterface; /** * Anexo ligado a uma linha do tempo ou a um ponto histórico (polimórfico simplificado por tipo + id). */ class Attachment extends Model { use HasFactory; use SoftDeletes; protected $connection = 'mysql'; public $incrementing = false; protected $keyType = 'string'; protected $table = 'lt_attachments'; protected $fillable = [ 'id', 'entity_type', 'entity_id', 'original_name', 'storage_key', 'mime_type', 'file_size_bytes', 'uploaded_by', ]; public static function boot(): void { parent::boot(); static::creating(function (self $model): void { if (empty($model->id)) { $model->id = (string) Str::uuid(); } }); } protected function serializeDate(DateTimeInterface $date): string { return $date->format('Y-m-d H:i:s'); } public function uploader(): BelongsTo { return $this->belongsTo(User::class, 'uploaded_by', 'id'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings