I need to encrypt routes in this URL? Because I do not want user to access URL by changing the item id. For example, user can change /items/1234 to /item/5678. Although item
You require encrypt URL ID/Any URL param and this is called id obfuscation. You can do it with hashids library. it converts an integer like 347 to yr8 and back again.
Include this library:
composer require hashids/hashids
You can get all other easy stuff from Easy id obfuscation with Laravel 5
This will help you to encrypt URL id:
http://example.com/users/123
TO
http://example.com/users/Mj3
Hope this will help you well!