File manager - Edit - /var/www/html/portal/app/Models/Cultura/ArteSacra/ComentarioArte.php
Back
<?php namespace App\Models\Cultura\ArteSacra; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; use DateTimeInterface; use App\Models\User; class ComentarioArte extends Model { use HasFactory; protected $connection = 'mysql_arte_sacra'; protected $table = 'comentario_arte'; public $incrementing = false; protected $keyType = 'string'; protected $fillable = [ 'id', 'acervo_id', 'user_id', 'historia_obra', 'status', ]; protected static function boot() { parent::boot(); static::creating(function ($model) { if (empty($model->id)) { $model->id = (string) Str::uuid(); } }); } protected function serializeDate(DateTimeInterface $date) { return $date->format('Y-m-d H:i:s'); } public function acervo() { return $this->belongsTo(Acervo::class, 'acervo_id'); } public function getUsuarioAttribute() { return User::on('mysql')->find($this->user_id); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings