You were almost there.
Remove protected $dates = ['license_expire']
and then change your LicenseExpire
accessor to:
public function getLicenseExpireAttribute($date)
{
return Carbon::parse($date);
}
This way it will return a Carbon
instance no matter what.
So for your form you would just have $employee->license_expire->format('Y-m-d')
(or whatever format is required) and diffForHumans()
should work on your home page as well.
Hope this helps!