Basic Routing 1
Basic Routing 1
• 3000
• 5000
• 8000
• 7000
By default laravel project runs on
which PORT?
• 3000
• 5000
• 8000
• 7000
Command to check the current version of
the Laravel Framwork?
Route::view('/welcome', 'welcome');
Route Parameters Constraints
• Route::pattern('id', '[0-9]+');
• }
• In the above code, we're using the Route::pattern
method to specify a regular expression pattern [0-9]+ for
the id parameter. This pattern requires that any id
parameter in your routes must consist of numeric
characters.
Question 1: What is Laravel routing
primarily used for?
• A. Database management
• B. Handling HTTP requests
• C. Front-end development
• D. Server configuration
What is Laravel routing primarily
used for?
• A. Database management
• B. Handling HTTP requests
• C. Front-end development
• D. Server configuration
In Laravel, where are the routes
typically defined?
• A. <param>
• B. [param]
• C. {param}
• D. (param)
Which of the following is used to
pass parameters in a Laravel route?
• A. <param>
• B. [param]
• C. {param}
• D. (param)
Which artisan command is used to list all
registered routes in a Laravel
application?
• A. whereNumber
• B. whereInteger
• C. whereNumeric
• D. whereDigit
Which built-in constraint is used to
ensure that a route parameter is
numeric?
• A. whereNumber
• B. whereInteger
• C. whereNumeric
• D. whereDigit
If you want to restrict a route parameter to
only alphabetic characters (A-Z and a-z),
which constraint would you use?
• A. whereAlpha
• B. whereAlphaNumeric
• C. whereRegex
• D. whereString
If you want to restrict a route parameter to
only alphabetic characters (A-Z and a-z),
which constraint would you use?
• A. whereAlpha
• B. whereAlphaNumeric
• C. whereRegex
• D. whereString