formatStateUsing not called if value is null
This does echo "Yes" but if
cancelled_at
is null
it wont show "No".6 Replies
Am I missing something here?
can you dd($state) and confirm it is actually
null
It is not calling
formatStateUsing
if the $state is null
It is only calling it for the ones which are not null
Solution
Use
getStateUsing()
insteadThat worked, thanks @Arko
π follow the instructions from @Answer Overflow to mark the solution