38 lines
815 B
PHP
38 lines
815 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
class SaasAppointment extends Base
|
|
{
|
|
protected $fillable = [];
|
|
protected $guarded = [];
|
|
|
|
public function getStartTimeAttribute()
|
|
{
|
|
if ($this->attributes['start_time']) {
|
|
return Carbon::parse($this->attributes['start_time'])->format('H:i');
|
|
}
|
|
}
|
|
|
|
public function getEndTimeAttribute()
|
|
{
|
|
if ($this->attributes['end_time']) {
|
|
$time = Carbon::parse($this->attributes['end_time'])->format('H:i');
|
|
if($time == '00:00'){
|
|
$time = '24:00';
|
|
}
|
|
return $time;
|
|
}
|
|
}
|
|
|
|
public function merchant()
|
|
{
|
|
return $this->hasOne(MerchantAccount::class, 'id', 'merchant_id');
|
|
}
|
|
|
|
}
|
|
|