I am using Laravel 5 and working on my local one. I made a route with the {id} parameter and another route with the same name:
Route::get('contacts/{id}', ' ContactController@get _contact'); Route::get('contacts/new', ' ContactController@new _contact');
My problem is that if I try to switch to localhost / contacts / new, it will automatically get access to the get_contact method. I understand that I made the {id} parameter, but what if I want to call get_contact only if my parameter is an integer? If this is not the case, check if it is "new" and access the new_contact method. Then, if it is not an integer, and not a "new", page 404 error.
How can I do this in Laravel 5?
Thank you for your help!
source share