Файловый менеджер - Редактировать - /home/clickysoft/public_html/calvary-p2.clickysoft.net/app/Models/Child.php
Назад
<?php namespace App\Models; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Child extends Model { use HasFactory, SoftDeletes; protected $fillable = [ 'user_id', 'grade_id', 'teacher_id', 'first_name', 'last_name', 'created_at', 'updated_at', 'deleted_at', ]; protected $appends = [ 'full_name', ]; public function getFullNameAttribute() { return $this->first_name . ' ' . $this->last_name; } public function grade() { return $this->belongsTo(Grade::class, 'grade_id'); } public function teacher() { return $this->belongsTo(Teacher::class, 'teacher_id'); } public function parent() { return $this->belongsTo(User::class, 'parent_id'); } protected function name(): Attribute { return Attribute::make( get: fn ($value) => $this->first_name." ".$this->last_name, ); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка