2017 © Pedro Peláez
 

library dynamicapi

laravel api dynamic manger

image

mustafah15/dynamicapi

laravel api dynamic manger

  • Thursday, September 15, 2016
  • by mustafah15
  • Repository
  • 1 Watchers
  • 3 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

dynamicapi

Api Manager for Laravel framework

Easy way to return response from your application with model data, (*1)

Installation

First open up a console in your project root and use composer to fetcht the package into your project, (*2)

composer require mustafah15/dynamicapi

Now go into your config/app.php and add the service provider:, (*3)

  Mustafah15\DynamicApi\DynamicApiServiceProvider::class,

Usage and Responses

Usage

Create new object form php DynamicApi() class, (*4)

  (new DynamicApi())->respond(User::all(),['name','email']);

It could take two params first one is the result from your model The second is optional param with keys you need to be showed, (*5)

Response

It return json response with data, status and totoal (number of how meny record in data), (*6)

{
    "status": 200,
    "total": 15,
    "data": [
        {
            "name": "example",
            "email": "example@example.com"
        },
        {
            "name": "example1",
            "email": "example1@example1.com"
        }
    ]
}

License

The package is open-sourced software licensed under the [MIT license]., (*7)

The Versions

15/09 2016

dev-master

9999999-dev

laravel api dynamic manger

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by mustafa hussain