PHPackages                             nf/restapi - 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. nf/restapi

ActiveLibrary[API Development](/categories/api)

nf/restapi
==========

Packages for nf-theme

1.2.0(8y ago)0181MITPHPPHP &gt;=5.6

Since Dec 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/nf-theme/api)[ Packagist](https://packagist.org/packages/nf/restapi)[ RSS](/packages/nf-restapi/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

Another way to working with Wordpress REST API
==============================================

[](#another-way-to-working-with-wordpress-rest-api)

> It's an extension for our theme

#### Installation

[](#installation)

##### Step 1: Install Through Composer

[](#step-1-install-through-composer)

```
composer require nf/restapi

```

##### Step 2: Add the Service Provider

[](#step-2-add-the-service-provider)

> Open `config/app.php` and register the required service provider.

```
  'providers'  => [
        // .... Others providers
        \NightFury\RestApi\Providers\RestApiProvider::class,
    ],
```

##### Step 3: Run publish command

[](#step-3-run-publish-command)

> It will create 2 new folders `routes` and `app/Http` in your theme

```
php command restapi:publish

```

##### Step 4: Register a route

[](#step-4-register-a-route)

> You can register any route by update `routes/api.php`

```
