PHPStan has found hundreds of errors in the Laravel project. Mostly, Access to an undefined property Illuminate\Database\Eloquent\Model::$id. for constructs like
$project_id = $checkpoint->project->id;
Does PHPStan not understand the relationships between Laravel models? (larastan is also installed)
Do I really need to rewrite everything to
$project_id = $checkpoint->project->id ?? null;
(then PHPStan doesn't complain).
I tried to overcome this error through PHPDoc, but even more changes would have to be made to the code here.