dev-master
9999999-devPackage Rest Full Server for Laravel 5.6
MIT
The Requires
The Development Requires
by Marcin Prus
Package Rest Full Server for Laravel 5.6
Package Rest Full API server for Laravel, (*1)
You can see package Client API package laravel-rest-client for use on a separate Laravel installation, (*2)
To install this package you will need:, (*4)
Laravel 5 (see compatibility table) PHP 7.0 +
Install via composer - edit your composer.json
to require the package., (*5)
``` json { "require": { "prusmarcin/laravel-rest-server": "dev-master" } }, (*6)
Then run `composer update` in your terminal to pull it in. Or via the command line in the root of your application installation. ``` bash $ composer require prusmarcin/laravel-rest-server
Once this has finished, you will need to add the service provider to the providers
array in your app.php
config as follows:, (*7)
``` php \Restserver\RestserverServiceProvider::class,, (*8)
And configure the database connection in `.env` file for your Laravel installation. Run migration ``` bash $ php artisan migrate
Note: If you have error when you run migration: "Specified key was too long error solution". Read this article: https://geektnt.com/laravel-5-4-migration-unique-key-is-too-long.html, (*9)
Run seeder, (*10)
``` bash $ php artisan db:seed --class=Restserver\Seeds\DatabaseSeeder, (*11)
Run laravel server ``` bash $ php artisan serve
And you're done!, (*12)
http://localhost:8000/api/items/available, (*13)
Returns, (*14)
``` json [{"id":5,"name":"Produkt 8","amount":2},{"id":4,"name":"Produkt 7","amount":6},{"id":2,"name":"Produkt 2","amount":12},{"id":1,"name":"Produkt 1","amount":4}], (*15)
More methods:  Testing ------- Run laravel server ``` bash $ php artisan serve
Then run the tests with:, (*16)
bash
$ vendor/bin/phpunit vendor/prusmarcin/laravel-rest-server
, (*17)
The MIT License (MIT). Please see License File for more information., (*18)
Package Rest Full Server for Laravel 5.6
MIT