noblemfd
2 months ago
440
5
Laravel

production.ERROR: The separation symbol could not be found

Posted 2 months ago by noblemfd

In my Laravel-5.8, I am trying to fomat date:

Model

public function setHireDateAttribute($value)
{
    $this->attributes['hire_date'] = Carbon::createFromFormat('d-m-Y', $value);
}
    
public function getHireDateAttribute($input)
{
    return Carbon::createFromFormat('Y-m-d', $input)
      ->format(config('app.date_format'));
}    

View:

<p for="">:{{ Carbon\Carbon::createFromFormat('d/m/Y', $employee->hire_date)->format('d-m-Y') }}</p>

When I rendered the view I got this error:

[2020-07-30 16:42:48] production.ERROR: The separation symbol could not be found Trailing data (View: C:\xampp\htdocs\laravelapp\resources\views\hr\employees\show.blade.php) {"userId":469,"exception":"[object] (ErrorException(code: 0): The separation symbol could not be found

How do I resolve this?

Thanks

Please sign in or create an account to participate in this conversation.