Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/app/Models/TimeEntry.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 TimeEntry extends Model { use SoftDeletes; use HasFactory; public $table = 'time_entries'; protected $dates = [ 'start_time', 'end_time', 'created_at', 'updated_at', 'deleted_at', ]; protected $fillable = [ 'work_type_id', 'project_id', 'start_time', 'end_time', 'created_at', 'updated_at', 'deleted_at', ]; public function work_type() { return $this->belongsTo(TimeWorkType::class, 'work_type_id'); } public function project() { return $this->belongsTo(TimeProject::class, 'project_id'); } public function getStartTimeAttribute($value) { return $value ? Carbon::createFromFormat('Y-m-d H:i:s', $value)->format(config('panel.date_format') . ' ' . config('panel.time_format')) : null; } public function setStartTimeAttribute($value) { $this->attributes['start_time'] = $value ? Carbon::createFromFormat(config('panel.date_format') . ' ' . config('panel.time_format'), $value)->format('Y-m-d H:i:s') : null; } public function getEndTimeAttribute($value) { return $value ? Carbon::createFromFormat('Y-m-d H:i:s', $value)->format(config('panel.date_format') . ' ' . config('panel.time_format')) : null; } public function setEndTimeAttribute($value) { $this->attributes['end_time'] = $value ? Carbon::createFromFormat(config('panel.date_format') . ' ' . config('panel.time_format'), $value)->format('Y-m-d H:i:s') : null; } 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
|
Настройка