For anyone that doesn’t know or doesn’t use it, Laravel supports route model binding. So instead of doing this: Route::get('/posts/{post}', function (int $postId) {
$post = Post::findOrFail($postId);
return $post;
}); You can do this: Route::get('/posts/{post}', function (Post $post) {
return $post;
}); Making it easier to load models, as well…