2017 © Pedro PelĂĄez
 

library lararest

The simplest way to create CRUD REST API routes.

image

davidhoeck/lararest

The simplest way to create CRUD REST API routes.

  • Thursday, March 23, 2017
  • by davidhoeck
  • Repository
  • 0 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

LaraRest

Latest Stable Version License Latest Unstable Version, (*1)

Keep your API routes file clean and generate your CRUD routes via LaraRest., (*2)

STEP 1

Install LaraRest via Composer., (*3)

composer require davidhoeck/lararest

STEP 2

Create your eloquent models., (*4)

STEP 3

Go to your api.php in the routes folder., (*5)

STEP 4

Initialize the RestApiProvider. Just paste the following lines of code, at the top of your api.php file., (*6)

/** @var \DavidHoeck\LaraRest\RestApiProvider $apiProvider */
$apiProvider = new \DavidHoeck\LaraRest\RestApiProvider();

STEP 5

Hook your models into the provider. Add every model your want your CRUD REST routes to be generate., (*7)

$apiProvider->addModel( new User() );

EXAMPLE

The following line of code ..., (*8)

$apiProvider->addModel( new User() );

... produces these routes., (*9)

Method URI Name Action Middleware
GET api/users api.users.index App\Http\Controllers\UserController@index api
DELETE api/users api.users.create App\Http\Controllers\UserController@create api
GET api/users/paginate api.users.paginate App\Http\Controllers\UserController@paginate api
GET api/users/{id} api.users.find App\Http\Controllers\UserController@find api
PUT api/users/{id} api.users.update App\Http\Controllers\UserController@update api
DELETE api/users/{id} api.users.delete App\Http\Controllers\UserController@delete api

The Versions

23/03 2017

dev-master

9999999-dev

The simplest way to create CRUD REST API routes.

  Sources   Download

MIT

The Requires

 

23/03 2017

1.2.0

1.2.0.0

The simplest way to create CRUD REST API routes.

  Sources   Download

MIT

The Requires

 

18/03 2017

1.1.4

1.1.4.0

The simplest way to create CRUD REST API routes.

  Sources   Download

MIT

The Requires

 

18/03 2017

1.1.3

1.1.3.0

The simplest way to create CRUD REST API routes.

  Sources   Download

MIT

The Requires

 

18/03 2017

1.1.1

1.1.1.0

The simplest way to create CRUD REST API routes.

  Sources   Download

MIT

18/03 2017

1.0

1.0.0.0

The simplest way to create CRUD REST API routes.

  Sources   Download

MIT