PHPackages                             paulvl/json-api - 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. [API Development](/categories/api)
4. /
5. paulvl/json-api

ActivePackage[API Development](/categories/api)

paulvl/json-api
===============

Package to fast implement an API with Laravel 5.1

3171PHP

Since Oct 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/paulvl/JsonApi)[ Packagist](https://packagist.org/packages/paulvl/json-api)[ RSS](/packages/paulvl-json-api/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

JsonApi
=======

[](#jsonapi)

\[TOC\]

**Introduction**
----------------

[](#introduction)

**Quick Installation**
----------------------

[](#quick-installation)

Begin by installing this package through Composer.

You can run:

```
composer require paulvl/json-api

```

Or edit your project's composer.json file to require paulvl/json-api.

```
    "require-dev": {
        "paulvl/json-api": "dev-master"
    }

```

Next, update Composer from the Terminal:

```
composer update --dev

```

Once the package's installation completes, the final step is to add the service provider. Open `config/app.php`, and add a new item to the providers array:

```
PaulVL\JsonApi\JsonApiServiceProvider::class,

```

Finally publish package's configuration file:

```
php artisan vendor:publish

```

Then the file `config/json-api.php` will be created.

That's it! You're all set to go. Run the artisan command from the Terminal to see the new `json-api` commands.

```
php artisan

```

**Models, Controllers and Routing**
-----------------------------------

[](#models-controllers-and-routing)

To fast deploy your RESTful JsonApi server you have to use `PaulVL\JsonApi\Model` and `PaulVL\JsonApi\Controller` classes.

### **Models**

[](#models)

Begin creating a model using `json-api:make-model` command. For example:

```
php artisan json-api:make-model Models\MyModel

```

This will create the `Models/MyModel.php` file that will look like this:

```
