Is it possible to make a route that takes a string parameter only for a specific string? Example:
route
Route::get('{user_tipe}/event', 'admin\ EventC@index ');
To route, I want to make the user_tipe parameter, allow only two lines, such as admin and author . Is it possible?
user_tipe
admin
author
You can do this using regex restrictions on your route:
Route::get('{user_tipe}/event', 'admin\ EventC@index ')->where('user_tipe', 'admin|author');
admin|author - a simple regular expression that matches the string admin or author
admin|author
Source: https://habr.com/ru/post/1269173/More articles:How to use Nix to set up a development environment? - nixpostgresql weird invalid input syntax for type numeric: "", and the value is not empty varchar - postgresqlHow to find out the type of output in Kotlin? - typesWhy do we use a try block to throw exceptions. we cannot just throw and catch them without a try block. What is its importance? - phpCalculation of credit impulse in growth growth - rValues ββstored in the database - phpAssumed Role in AWS Lambda, Access Denied by SSM Call - amazon-web-servicespython calls a module that uses argparser - pythonCity names for coordinates lon, lat - pythonboto3 start / stop RDS instance with AWS Lambda - pythonAll Articles