mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
34 lines
955 B
PHP
34 lines
955 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
class PermitsReminder extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'permits_reminders';
|
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
protected $fillable = ['model', 'expiry_date', 'reminder_date'];
|
|
|
|
public function getExpiryDateAttribute($value)
|
|
{
|
|
return $this->attributes['expiry_date'] === null ? NULL : Carbon::parse($this->attributes['expiry_date'])->format('d-m-Y');
|
|
}
|
|
|
|
public function getReminderDateAttribute($value)
|
|
{
|
|
return $this->attributes['reminder_date'] === null ? NULL : Carbon::parse($this->attributes['reminder_date'])->format('d-m-Y');
|
|
}
|
|
|
|
public function getCreatedAtAttribute($value)
|
|
{
|
|
return $this->attributes['created_at'] === null ? NULL : Carbon::parse($this->attributes['created_at'])->format('d-m-Y');
|
|
}
|
|
}
|