TODO: Rename `Route::over()` to `Route::hit()`
taufik-nurrohman opened this issue · comments
Taufik Nurrohman commented
The term hit
is more appropriate to me. over
seems to have missed the under
, something that will never exist for routes because every success response will be immediately stopped by exit
. So, even if we have Route::under()
someday, then its callback function is likely will never be executed due to the exit
expression at the end of the response.
Route::hit('foo/bar', function() {});
This method is in line with the Cache::hit()
method so it is easy to scan and remember the API.
Possible extension that will be affected by this change:
Consider to use if (Route::is('foo/bar')) {}
where applicable since this method is likely will be exist forever.