Carbon\Carbon not found SOME of the time

Kyle Wardle posted 10 months ago

So currently I pull back a date and convert it to a readable format in carbon:

<div class="">
 <label for="Name">Letter Sent:</label>
 @if (is_null($Client->letter_posted))
   {{  \carbon\carbon::createFromFormat('Y-m-d',$Client->letter_posted)->format('d/m/Y')}}

And it works when testing the majority of the time (Testing both whilst letter_posted is null and not) however very occasionally it will spit out the error:

Class 'carbon\carbon' not found

It has only occurred 3 times in the last 2 months very randomly and a refresh of the page will remove this error eg. the error appears, if you refresh the page it is no longer there.

Any help appreciated.

Sign in to participate in this thread!

We'd like to thank these amazing companies for supporting us