Файловый менеджер - Редактировать - /home/clickysoft/public_html/charliapp-v2.clickysoft.net/app/Models/Calendar.php
Назад
<?php namespace App\Models; use \DateTimeInterface; use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Calendar extends Model { use HasFactory; public $table = 'calendars'; protected $dates = [ 'event_date', 'created_at', 'updated_at', 'deleted_at', ]; protected $fillable = [ 'user_id', 'title', 'description', 'location', 'event_date', 'start_time', 'end_time', 'color_id', 'tag_id', 'end_date', 'created_at', 'updated_at', 'deleted_at', ]; public function getEventDateAttribute($value) { return $value ? Carbon::parse($value)->format(config('panel.date_format')) : null; } public function getEventDateFormattedAttribute($value) { return (new Carbon($value))->format('F d, Y'); } public function setEventDateAttribute($value) { $this->attributes['event_date'] = $value ? Carbon::createFromFormat(config('panel.date_format'), $value)->format('Y-m-d') : null; } public function user() { return $this->belongsTo(User::class, 'user_id'); } public function color() { return $this->belongsTo(Color::class, 'color_id'); } public function tag() { return $this->belongsTo(Tag::class, 'tag_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
|
Настройка