To retrieve the requested URI, “path” method will be used. The “is” method is used to retrieve the requested URI which matches the particular pattern specified in the argument of the method. User can use the “url” method to get full URL.
Step 1 − Execute the below command to create a new controller calledUriController.
Step 2 – User can see the following output, after successful execution of the URL
Step 3 – Create a controller and add the following code in that file.
Step 4 − Add the following line in the app/Http/route.php file.
Step 5 − Visit the following URL.
Step 6 − Output will be displayed as in the below image.
Laravel retrieving input method will retrieve input values for both methods same way, either “get” and “post”. There are two ways we can retrieve the input values.
The input() method has only argument, it is the name of the field in form. For example, if the form contains username field then, user can access it by using below
User can get the username property directly from the request instance like the input() method
Step 2 − Execute the below command to create a UserRegistrationcontroller.
Step 3 − User can see the below output, after successful execution.
Step 4 − Copy the following code in app/Http/Controllers/UserRegistration.php controller.
Step 5 − Add the following line in app/Http/routes.php file.
Step 6 – User can see the registration form as displayed in the following picture by visiting the following URL. Type the registration details and click Register to see on the second page, for the displayed the user registration details.
Step 7 − Output can be seen as shown in the below images.
Laravel Related Interview Questions
|Python Interview Questions||PHP Interview Questions|
|Zend Interview Questions||AJAX Interview Questions|
|MySQL Interview Questions||Drupal Interview Questions|
|WordPress Interview Questions||Java Abstraction Interview Questions|
|Phonegap Interview Questions||wxPython Interview Questions|
|PHP7 Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.