Answer Posted / nafees ahmad
The “path” method is used to retrieve the requested URI.
The is method is used to retrieve the requested URI which matches the particular pattern specified in the argument of the method.
To get the full URL, we can use the url method.
Example :
Step 1 - Execute the below command to create a new controller called UriController. " php artisan make:controller UriController –plain " .
Step 2 - After successful execution of the URL, you will receive the following output.
Step 3 - After creating a controller, add the following code in that file. " app/Http/Controllers/UriController.php" .
Step 4 - Add the following line in the app/Http/route.php file. " app/Http/route.php".
Step 5 - Visit the following URL. " http://localhost:8000/foo/bar " .
Step 6 - The output will appear as shown on your screen.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain how to resolve class instance out of the container in laravel?
Explain fluent query builder in laravel.
What is singleton design pattern in laravel?
What is Laravel - Middleware ?
How to create model controller and migration in a single artisan command in laravel?
What is url in laravel?
What is localization?
How to create real time sitemap.xml file in laravel?
Is laravel any good?
What is the directory structure of laravel 5.6?
What are some use valet commands?
Define hashing in laravel.
How to install installing mariadb on homestead?
How do you generate urls?
How much laravel experience do you have?