PHPackages                             rygilles/laravel-api-boilerplate - 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. rygilles/laravel-api-boilerplate

AbandonedArchivedProject[Framework](/categories/framework)

rygilles/laravel-api-boilerplate
================================

Laravel API Boilerplate project.

v0.4.2(7y ago)10786MITPHPPHP &gt;=7.1

Since Sep 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/rygilles/laravel-api-boilerplate)[ Packagist](https://packagist.org/packages/rygilles/laravel-api-boilerplate)[ RSS](/packages/rygilles-laravel-api-boilerplate/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (23)Versions (23)Used By (0)

Laravel API Boilerplate
=======================

[](#laravel-api-boilerplate)

[![StyleCI](https://camo.githubusercontent.com/420f84696f11713c9a80c20b28a60eaa6bb0ec5b37b2af42f1f8d6f1b6312116/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3130343038363936312f736869656c643f7374796c653d666c6174)](https://github.styleci.io/repos/104086961/shield?style=flat)[![Build Status](https://camo.githubusercontent.com/aac6ec5a0463ad052dac30fc354eb4f5e12ac3cf3bcd6d5ca4b2120ca9ad25e9/68747470733a2f2f7472617669732d63692e6f72672f727967696c6c65732f6c61726176656c2d6170692d626f696c6572706c6174652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rygilles/laravel-api-boilerplate)

This is a Laravel [Laravel 5.\*](https://laravel.com/) based project.

Prerequisites
-------------

[](#prerequisites)

- [PHP 7.\*+](http://php.net/) (for Laravel 5.5+ framework)
- [Node.js 6.\*+](https://nodejs.org)
- [Redis 3+](https://redis.io/)
- [Laravel Echo Server 1.3.\*+](https://github.com/tlaverdure/laravel-echo-server) installed globally
- [PM 2](http://pm2.keymetrics.io/) (Optional : Run Laravel Echo Server as a "daemon")

Setup
-----

[](#setup)

Run this command and make sure to chmod properly the storage and cache folders.

```
composer create-project --prefer-dist rygilles/laravel-api-boilerplate your-project-name
```

Or install this project manually by cloning with git. In this case, you must copy the [.env.example](./.env.example) file to .env and run this command :

```
php artisan key:generate
```

### .env file

[](#env-file)

Check the [.env](./.env.example) file and change the values according to you preferences.

Libs
----

[](#libs)

This project uses the same libraries as Laravel common projects.

But also (Check [composer.json](./composer.json) and [package.json](./package.json) file for details) :

### Production environment

[](#production-environment)

#### PHP, with composer

[](#php-with-composer)

- [alsofronie/eloquent-uuid](https://github.com/alsofronie/eloquent-uuid) for User, UserGroup and Notification models.
- [bugsnag/bugsnag-laravel](https://github.com/bugsnag/bugsnag-laravel) for debug purpose (Set BUGSNAG\_API\_KEY in your [.env](./.env.example#L48) file).
- [dingo/api](https://github.com/dingo/api) for Api features.
- [felixkiss/uniquewith-validator](https://github.com/felixkiss/uniquewith-validator) for advanced validation rule.
- [filp/whoops](https://github.com/filp/whoops) for better error display in debug mode.
- [predis/predis](https://github.com/nrk/predis) for interactions with redis server and [laravel-echo-server](https://github.com/tlaverdure/laravel-echo-server).
- [rygilles/laravel-apidoc-generator](https://github.com/rygilles/laravel-apidoc-generator) for generating Api documentation.
- [rygilles/laravel-openapi-schema-generator](https://github.com/rygilles/laravel-openapi-schema-generator) for generating Open API json file.

#### Back-office, Node.js dependencies

[](#back-office-nodejs-dependencies)

- [laravel-echo](https://github.com/laravel/echo) : Laravel Echo is a JavaScript library that makes it painless to subscribe to channels and listen for events broadcast by Laravel.
- [socket.io-client](https://github.com/socketio/socket.io-client) : Realtime application framework (client) used with Laravel Echo.

### Development environment

[](#development-environment)

- [nikic/php-parser](https://github.com/nikic/PHP-Parser) : PHP parsing (Used with the `php artisan app:makeApiModelResource` command).
- [twig/twig](https://github.com/twigphp/Twig) : Twig template rendering (Used with the `php artisan app:makeApiModelResource` command).
- [barryvdh/laravel-ide-helper package](https://github.com/barryvdh/laravel-ide-helper) : Tool for generating Laravel definitions (PhpDoc) php file. Adding auto-complete in your IDE.

#### Back-office, Node.js dependencies

[](#back-office-nodejs-dependencies-1)

Vue.js :

- [vue](https://github.com/vuejs/vue) : Vue.js javascript framework for back-office UI.
- [vuex](https://github.com/vuejs/vuex) : Centralized state management for Vue.js.
- [vue-router](https://github.com/vuejs/vue-router) : Official router for Vue.js.
- [vue-i18n](https://github.com/kazupon/vue-i18n) : Translations management in Vue.js.
- [vue-gravatar](https://github.com/JiriChara/vue-gravatar) : A dead-simple gravatar component for Vue.js.

Graphics :

- [admin-lte](https://github.com/almasaeed2010/AdminLTE) : Back-office dashboard and control panel.
- [bootstrap-less](https://github.com/distros/bootstrap-less) and [bootstrap-sass](https://github.com/twbs/bootstrap-sass) : Used with AdminLTE.
- [node-sass](https://github.com/sass/node-sass) : Used with AdminLTE.
- [font-awesome](https://github.com/FortAwesome/Font-Awesome) : Used with AdminLTE.
- [ionicons](https://github.com/ionic-team/ionicons) : Used with AdminLTE.
- [noty](https://github.com/needim/noty) : Live notifications UI.
- [datatables.net-select-dt](https://github.com/DataTables/Dist-DataTables-Select-DataTables) : Used for custom data table component styles.

Laravel :

- [laravel-mix](https://github.com/JeffreyWay/laravel-mix) : An elegant wrapper around Webpack for the 80% use case.
- [cross-env](https://github.com/kentcdodds/cross-env) : Cross platform setting of environment scripts.

Miscellaneous :

- [jquery](https://github.com/jquery/jquery) : Used with AdminLTE.
- [axios](https://github.com/mzabriskie/axios) : Authentication and Api requesting.
- [pace](https://github.com/HubSpot/pace) : Dynamic loading bar (Top of the screen).
- [lodash](https://github.com/lodash/lodash) : JavaScript utility library used with Vue.js.
- [moment](https://github.com/moment/moment) : Dates formatter.

Database
--------

[](#database)

This application use InnoDB tables for foreign keys constraint support and utf8mb4\_unicode\_ci encoding for modern chars support (including emoji). It also use UUID (128 bits).

### Initialize

[](#initialize)

Run this command to create the database basics with default migrations (check [database/migrations](./database/migrations) directory).

*Make sure Redis is installed properly.*

```
php artisan app:makeFresh
```

This will install :

**Laravel basic tables** : user, password\_resets, notification, jobs

**Passport bundle tables** : oauth\_auth\_codes, oauth\_access\_tokens, oauth\_refresh\_tokens, oauth\_clients\_table, oauth\_personal\_access\_clients)

**Boilerplate tables** : i18n\_lang, user\_group

### Samples Data

[](#samples-data)

An Artisan command (See below) can supply your database with samples data for users, projects, etc, for testing and documentation generation purpose.

*Check [database/seeds/Samples](./database/seeds/Samples) folder for more information.*

User IDUser Group IDNameEmailPassword`41abdec2-1389-11e7-93ae-92361f002671`DeveloperJohn Doejohndoe`509dd5c0-1389-11e7-93ae-92361f002671`SupportAlan Smitheealansmithee`605c7610-1389-11e7-93ae-92361f002671`End-UserJohn Smithjohnsmith`82b5da82-138c-11e7-93ae-92361f002671`End-UserMickey MousemickeymouseNode, Laravel Mix and Laravel Echo Server
-----------------------------------------

[](#node-laravel-mix-and-laravel-echo-server)

### NodeJs

[](#nodejs)

Install NodeJs dependencies (check [package.json](./package.json) file for more information).

```
npm install
```

### Laravel Mix

[](#laravel-mix)

#### Assets

[](#assets)

Create your own back-office images by replacing :

- [resources/assets/img/dashboard-logo.png](./resources/assets/img/dashboard-logo.png) (50 x 200)
- [resources/assets/img/dashboard-mini-logo.png](./resources/assets/img/dashboard-mini-logo.png) (50 x 50)
- resources/assets/img/favicon.jpg

*Check the [webpack.mix.js](./webpack.mix.js) to enable favicon.jpg copy and manage you own assets.*

#### Compilation

[](#compilation)

Run this command to compile the assets

```
npm run dev
```

### Laravel Echo Server

[](#laravel-echo-server)

Real-time notifications and events are send by a local Node.js server, using Redis and Socket.io.

The whole process is handled by [laravel-echo-server](https://github.com/tlaverdure/laravel-echo-server).

Initialize Laravel Echo Server by creating [laravel-echo-server.json](./laravel-echo-server.json) configuration file with this command :

```
laravel-echo-server init
```

#### Start and Auto-restart

[](#start-and-auto-restart)

Use PM2 for auto-restart feature

*Make sure you've configured all in [laravel-echo-server.ecosystem.config.json](./laravel-echo-server.ecosystem.config.json) file.* :

```
pm2 start laravel-echo-server.ecosystem.config.json
```

Or use this command to manually start the server :

```
laravel-echo-server start
```

Artisan commands
----------------

[](#artisan-commands)

### app:makeFresh

[](#appmakefresh)

```
php artisan app:makeFresh
```

This command will reset/refresh migrations, re-create required database data and (optionally) create a fresh app with samples data.

### app:generateApiDocs

[](#appgenerateapidocs)

```
php artisan app:generateApiDocs
```

Generate API documentation using current database resources.

*Make sure you've configured all in [config/apidocs.php](./config/apidocs.php) file.*

### app:makeApiModelResource

[](#appmakeapimodelresource)

```
php artisan app:makeApiModelResource
```

**Only in development environment !**

Generate and **MODIFY** source files to add a new model with related files :

- Model : Created in [app/Models](./app/models) folder.
- Migration (Optional) : Created in [database/migrations](./database/migrations) folder.
- Init seeder (Optional) : Created in [database/seeds](./database/seeds) folder. That will also **MODIFY** the [database/seeds/InitSeeder.php](./database/seeds/InitSeeder.php) file !
- Samples seeder (Optional) : Created in [database/seeds/Samples](./database/seeds/Samples) folder. That will also **MODIFY** the [database/seeds/Samples/SamplesSeeder.php](./database/seeds/Samples/SamplesSeeder.php) file !
- Controller (Optional) : Created in [app/Http/Controllers/Api](./app/Http/Controllers/Api) folder. That will also **MODIFY** the [routes/api.php](./routes/api.php) file !
- Requests : Will be generated if "store" method or "update" method making is wanted. In [app/Http/Requests](./app/Http/Requests) folder.
- Transformer : Will be generated if needed. In [app/Http/Transformers/Api](./app/Http/Transformers/Api) folder.

During this command execution, the Laravel application will be down (`php artisan down` then `php artisan up` at the end, called implicitly).

Composer dump autoloads will be called at the end.

### app:makeApiModelResourceAssets

[](#appmakeapimodelresourceassets)

```
php artisan app:makeApiModelResourceAssets
```

**Only in development environment !**

Generate and **MODIFY** basic assets source files for a new resource model in the dashboard :

- Resource model list vue component : Created in [resources/assets/js/components/dashboard](./resources/assets/js/components/dashboard) folder.
- Resource model item vue component : Created in [resources/assets/js/components/dashboard](./resources/assets/js/components/dashboard) folder.
- Resource model locales js files : Created in [resources/assets/js/locales](./resources/assets/js/locales) folder (one file per locale).
- Routes locales js files [resources/assets/js/locales/en/routes.js](./resources/assets/js/locales/en/routes.js) and other locales file : **MODIFY** to add resource model list and item routes.
- Vuex store js file [resources/assets/js/store.js](./resources/assets/js/store.js) : **MODIFY** to add resource model state, getters, mutations and actions.
- Routes js file [resources/assets/js/routes.js](./resources/assets/js/routes.js) : **MODIFY** to add resource model list and item routes.
- Side-bar menu vue component file [resources/assets/js/components/includes/sidebar-menu.vue](./resources/assets/js/components/includes/sidebar-menu.vue) : **MODIFY** to add resource model links *(interactive)*.

During this command execution, the Laravel application will be down (`php artisan down` then `php artisan up` at the end, called implicitly).

Make sure to run `npm run dev` or `npm run watch` to check your assets compilation.

*(Upcoming upgrades to do : Model resource analysis to complete new components fields and other stuff like this.)*

### openApiSchemas:generate

[](#openapischemasgenerate)

```
php artisan openApiSchemas:generate
```

This command is provided by the [rygilles/laravel-openapi-schema-generator](https://github.com/rygilles/laravel-openapi-schema-generator) package.

It will analyze your laravel project files and generate a openapi json file, describing the capabilities of your Api.

Check the [config/openapischemas.php](./config/openapischemas.php) configuration file before running this command.

Some information can not be retrieve automatically by the script, you might update/add data in the ["openapi\_bindings" configuration array](./config/openapischemas.php#L177#L548).

### ide-helper:generate

[](#ide-helpergenerate)

```
php artisan ide-helper:generate
```

This command is provided by [barryvdh/laravel-ide-helper package](https://github.com/barryvdh/laravel-ide-helper).

*Only for development environment*

This package generates a file that your IDE understands, so it can provide accurate autocompletion. Generation is done based on the files in your project, so they are always up-to-date. If you don't want to generate it, you can add a pre-generated file to the root folder of your Laravel project (but this isn't as up-to-date as self generated files).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~54 days

Total

21

Last Release

2738d ago

PHP version history (2 changes)v0.1PHP &gt;=5.6.4

v0.2.5.2PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1ea3c30eaabe0dcdb7ddf801f2ce66fb6ed33b83601799cec95c3b578c390cf?d=identicon)[rygilles](/maintainers/rygilles)

---

Top Contributors

[![rygilles](https://avatars.githubusercontent.com/u/7666960?v=4)](https://github.com/rygilles "rygilles (6 commits)")

---

Tags

apiframeworklaravelboilerplate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rygilles-laravel-api-boilerplate/health.svg)

```
[![Health](https://phpackages.com/badges/rygilles-laravel-api-boilerplate/health.svg)](https://phpackages.com/packages/rygilles-laravel-api-boilerplate)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
