Creating Restful API in Laravel 5.7
loader
Creating Restful API in Laravel 5.7
Aug 17, 2021
Laravel
By: Sarck Solution

Creating Restful API in Laravel 5.7

A RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is an architectural style and approach to communications often used in web services development. REST API helps us to do Web and Mobile Development simultaneously by helping us connect database and do operations.

These APIs communicate with the application through endpoints. Let's say for example www.restapisample.com/users gives details of all users. This endpoint can be used in any web application or mobile application to achieve the task of displaying users.

So today we will develop REST API in Laravel 5.7

STEP 1: Install Composer

Composer is a dependency manager for PHP like Pip is for python. Here we will use composer to install laravel project and its dependency. To install composer visit https://getcomposer.org/download/

STEP 2: Installing Laravel via Laravel Installer.

First, download the Laravel installer using Composer.

Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new RestApi will create a directory named RestApi containing a fresh Laravel installation with all of Laravel’s dependencies already installed.

To check what is the version of the project installed, you can use the command.


Tags:
Leave A Reply