Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/app/Models/Project.php
Назад
<?php namespace App\Models; use \DateTimeInterface; use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Project extends Model { use SoftDeletes; use HasFactory; public $table = 'projects'; protected $dates = [ 'start_date', 'created_at', 'updated_at', 'deleted_at', ]; protected $fillable = [ 'name', 'client_id', 'description', 'start_date', 'budget', 'status_id', 'created_at', 'updated_at', 'deleted_at', ]; public function client() { return $this->belongsTo(Client::class, 'client_id'); } public function getStartDateAttribute($value) { return $value ? Carbon::parse($value)->format(config('panel.date_format')) : null; } public function setStartDateAttribute($value) { $this->attributes['start_date'] = $value ? Carbon::createFromFormat(config('panel.date_format'), $value)->format('Y-m-d') : null; } public function status() { return $this->belongsTo(ProjectStatus::class, 'status_id'); } protected function serializeDate(DateTimeInterface $date) { return $date->format('Y-m-d H:i:s'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка