Very sophisticated REST API using Laravel 5.4. You can find all what you need in this example to create an API of your dream.
-
How to use Laravel Transformer to customise the response.
-
Authentication using Laravel Passport
-
Create a unique slug using Eloquent-Sluggable
https://demo.halimlardjane.com/laravel-rest
1- After you pull up the project, browse to the folder with your terminal and run:
> composer install
2- To generate Laravel key, in your Terminal run:
> php artisan key:generate
3- Create a Database in Your MySQL (choose a name, for example: librarydb)
4- Create an new file .env in the base folder containing a copy of the file .env.example, and update the cresential of databases connexion
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=librarydb
DB_USERNAME=root
DB_PASSWORD=
Make sure also to out at API_PREFIX=api in your .env file Like this
API_PREFIX=api
API_NAME="Laravel API"
API_VERSION=v1
API_DEBUG=false
5- To migrate the database, In your Terminal run:
> php artisan migrate
6- To fill the tables with some dummy data, In your Terminal run:
> php artisan db:seed
7- To run the server and test the API, In your Terminal run:
> php artisan serve
8- Under construction...