File manager - Edit - /var/www/html/portal/app/Models/Accounts/Cronogramas/Comment.php
Back
<?php namespace App\Models\Accounts\Cronogramas; use App\Models\User; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Str; use DateTimeInterface; /** * Comentário em uma atividade de cronograma. */ class Comment extends Model { use SoftDeletes; protected $connection = 'mysql'; public $incrementing = false; protected $keyType = 'string'; protected $table = 'cr_comments'; protected $fillable = [ 'id', 'activity_id', 'user_id', 'content', ]; 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 activity(): BelongsTo { return $this->belongsTo(Activity::class, 'activity_id', 'id'); } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id', 'id'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings