Skip to content

Instantly share code, notes, and snippets.

@stefanzweifel
Created March 4, 2019 08:05
Show Gist options
  • Save stefanzweifel/6486ca706919bc2a00243351ba646458 to your computer and use it in GitHub Desktop.
Save stefanzweifel/6486ca706919bc2a00243351ba646458 to your computer and use it in GitHub Desktop.
Calculate the number of routes in a Laravel Project
<?php
return collect(Route::getRoutes())
->reject(function ($item) {
return starts_with($item->uri, 'horizon');
})
->reject(function ($item) {
return starts_with($item->uri, 'nova');
})
->reject(function ($item) {
return starts_with($item->uri, '__clockwork');
})
->reject(function ($item) {
return starts_with($item->uri, 'themsaid');
})
->pluck('uri')
->count();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment