public function update(?User $user, Post $post)
{
return $user->id === $post->user_id;
}
In the above function there is a '?' in front of User model type hinting.
What is the use case of this operator in function parameter?
public function update(?User $user, Post $post)
{
return $user->id === $post->user_id;
}
In the above function there is a '?' in front of User model type hinting.
What is the use case of this operator in function parameter?