Skip to content

Instantly share code, notes, and snippets.

@assertchris
Created September 29, 2022 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save assertchris/1881edc0fa626ac47b758091824c9649 to your computer and use it in GitHub Desktop.
Save assertchris/1881edc0fa626ac47b758091824c9649 to your computer and use it in GitHub Desktop.
<?php
Route::get('/{post}/{comments?}', ...)->benchmark([
'Simple post' => ['post' => Post::first()],
'Complex post' => ['post' => Post::whereComplex()->first()],
'Post with 10 coments' => ['post' => Post::withComments()->first(), 'comments' => 10]
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment