Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is Basic Response in Laravel ?



What is Basic Response in Laravel ?..

Answer / nafees ahmad

Laravel provides several different ways to return response.
Response can be sent either from route or from controller.
The basic response that can be sent is simple string as shown in the below sample code.
This string will be automatically converted to appropriate HTTP response.

Example :
Step 1 - Add the following code to app/Http/routes.php file.
app/Http/routes.php
Route::get('/basic_response', function () {
return 'Hai to One and All';
});

Step 2 - Visit the following URL to test the basic response.

http://localhost:8000/basic_response

Step 3 - The output will appear as shown in your screen.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

Is laravel easy?

0 Answers  


How can we turn off csrf protection for a particular route?

0 Answers  


What is difference between implicit and explicit route binding in laravel?

0 Answers  


Explain how to install valet?

0 Answers  


Can we assign multiple middlewares to a route.

0 Answers  


What is laravel api?

0 Answers  


What is laravel api rate limit?

0 Answers  


Explain me active record implementation. How to use it laravel?

0 Answers  


How do I register a service provider?

0 Answers  


How to use update query in laravel?

0 Answers  


What is composer in laravel?

0 Answers  


Why use route?

0 Answers  


Categories