2017 © Pedro Peláez
 

library laravel-rest-server

Package Rest Full Server for Laravel 5.6

image

prusmarcin/laravel-rest-server

Package Rest Full Server for Laravel 5.6

  • Tuesday, April 10, 2018
  • by prusmarcin
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

laravel-rest-server

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)

Total Downloads Latest Stable Version License, (*3)

Installation

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)

Usage

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: ![Screenshot](route-list.jpg) Testing ------- Run laravel server ``` bash $ php artisan serve

Then run the tests with:, (*16)

bash $ vendor/bin/phpunit vendor/prusmarcin/laravel-rest-server, (*17)

Author

License

The MIT License (MIT). Please see License File for more information., (*18)

The Versions

10/04 2018

dev-master

9999999-dev

Package Rest Full Server for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires