From the course: Building RESTful APIs in Laravel

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

GET all petitions

GET all petitions

From the course: Building RESTful APIs in Laravel

Start my 1-month free trial

GET all petitions

- [Instructor] Let's learn how we can create a new request. We can either create it from the launch pad by using the new button or by clicking on these three dots and selecting add request. Let's give it a name, GET petitions and save it in the E petitions collection. We now have a new empty request. The GET method has been selected automatically but as you can see, we have access to all methods. But for now, let's work with GET because we are going to get all petitions from our forward slash API, forward slash petitions endpoint testing the index action on the petitions controller. The request URL will be the full URL of our project as we displayed it in the browser. But before we send the request, let's make sure we are running PHP artisans server in our terminal. I'm going to click on this link which takes me to the project homepage, go to forward slash API, forward slash petitions, to see all petitions in the…

Contents