laravel碳未定日期

Right now I have a model that has a "followup" date that is rotected to convert to carbon (). The issue is in my controller if I have some dates that are not set and default (0000-00-00) Carbon returns them as -0001-11-30 00:00:00.000000. I get why, but trying to target those dates and just return "none" but cant figure out how.

in my controller:

foreach ($account->notes as $note) {

                $notes[$i]['note']       = $note;
                $notes[$i]['account']    = $account->name;

                if($note->followup != '-0001-11-30 00:00:00.000000'){
                     $notes[$i]['followup']   = $note->followup->diffForHumans();
                 } else {
                    $notes[$i]['followup']   = 'None';
                 }


               $i += 1;
           }

The following approach should give you the output you're looking for:

foreach ($account->notes as $note) {
    $notes[$i]['note']     = $note;
    $notes[$i]['account']  = $account->name;
    $notes[$i]['followup'] = (substr($note->followup, 0, 1) !== '-') ? $note->followup->diffForHumans() : 'None';

    $i += 1;
}

But I'm confused as to why the approach you posted isn't working if you're checking for the precise value you're dumping out in your conditional statement.