belongsTo(MerchantUser::class, 'merchant_user_id', 'id'); } public function merchant(){ return $this->belongsTo(MerchantAccount::class,'merchant_id','id'); } public function anchor() { return $this->belongsTo(Anchor::class, 'merchant_id', 'm_id'); } 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; } } }