File manager - Edit - /var/www/html/portal/app/Models/Accounts/Cronogramas/Dependency.php
Back
<?php namespace App\Models\Accounts\Cronogramas; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Support\Str; /** * DependĂȘncia entre atividades (predecessora). */ class Dependency extends Model { protected $connection = 'mysql'; public $incrementing = false; protected $keyType = 'string'; protected $table = 'cr_dependencies'; protected $fillable = [ 'id', 'activity_id', 'predecessor_id', ]; public static function boot(): void { parent::boot(); static::creating(function (self $model): void { if (empty($model->id)) { $model->id = (string) Str::uuid(); } }); } public function activity(): BelongsTo { return $this->belongsTo(Activity::class, 'activity_id', 'id'); } public function predecessor(): BelongsTo { return $this->belongsTo(Activity::class, 'predecessor_id', 'id'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings