PHPackages                             moraesgil/api-restful-trait - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. moraesgil/api-restful-trait

ActiveLibrary[Framework](/categories/framework)

moraesgil/api-restful-trait
===========================

A simple Laravel trait with restful crud implementation.

v1.0.0(7y ago)5251MITPHP

Since Sep 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MoraesGil/ApiRestfulTrait)[ Packagist](https://packagist.org/packages/moraesgil/api-restful-trait)[ RSS](/packages/moraesgil-api-restful-trait/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

ApiRestfulTrait
===============

[](#apirestfultrait)

A simple Laravel trait with restful crud implementation.

Installation
------------

[](#installation)

### With Composer

[](#with-composer)

```
$ composer require moraesgil/api-restful-trait

```

```
{
   "require": {
      "moraesgil/api-restful-trait": "~1.0"
   }
}
```

### Usage

[](#usage)

create your routes in routes/api.php or your prefer routes file

```
Route::resource('/samples', 'YourLaravelController', ['except' => ['create', 'edit', 'show']]);
```

make sure you have a model at App\\Entities\\YourModel same name of controller to Autoload model entity, or you can inject dependencies, see bellow the following instructions in Extras area...

```
//terminal
php artisan make model YourLaravel

```

In your Controller

```
use Traits\Controllers\ApiRestfulTrait;  //
