PHPackages                             ddiimmkkaass/lumen-api-generator - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ddiimmkkaass/lumen-api-generator

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ddiimmkkaass/lumen-api-generator
================================

Two simple tools for building REST APIs with fractal: console generator and API skeleton

1.1.0(8y ago)1215MITPHPPHP &gt;=5.4.0

Since Jul 15Pushed 8y ago2 watchersCompare

[ Source](https://github.com/DDiimmkkaass/lumen-api-generator)[ Packagist](https://packagist.org/packages/ddiimmkkaass/lumen-api-generator)[ Docs](https://github.com/DDiimmkkaass/lumen-api-generator)[ RSS](/packages/ddiimmkkaass-lumen-api-generator/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/87479430b96638c2cb03aa8ec6bbcb873a80d8545764116b1da7f721684d724e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f444469696d6d6b6b616173732f6c756d656e2d6170692d67656e657261746f722e7376673f7374796c653d666c6174)](https://packagist.org/packages/DDiimmkkaass/lumen-api-generator)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/033bf7672800eb58138fa3d5726e083676a08fc3299bb14ce462335956fd8c87/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f444469696d6d6b6b616173732f6c756d656e2d6170692d67656e657261746f722f6d61737465722e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/DDiimmkkaass/lumen-api-generator/)[![MIT License](https://camo.githubusercontent.com/e7aab4eee07caecf2b8fcc3bf6febc4757a7c6d69c9cbfffc9e89827c48461a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f444469696d6d6b6b616173732f6c756d656e2d6170692d67656e657261746f722e7376673f7374796c653d666c6174)](https://packagist.org/packages/DDiimmkkaass/lumen-api-generator)

This is the full copy of [arrilot/laravel-api-generator](https://github.com/arrilot/laravel-api-generator) adapted for Lumen
============================================================================================================================

[](#this-is-the-full-copy-of-arrilotlaravel-api-generator-adapted-for-lumen)

Lumen Api Generator
===================

[](#lumen-api-generator)

*Two simple tools for building REST APIs with fractal: console generator and API skeleton*

Introduction
------------

[](#introduction)

This package provides two features

1. Console generator which creates Controller, Fractal Transformer and routes in a single command.
2. Basic REST API skeleton that can be really helpful if you need something standard. It's 100% optional.

If you do not use Fractal for your transformation layer, this package is probably not the right choice for you.

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

[](#installation)

1. Run `composer require ddiimmkkaass/lumen-api-generator`
2. Register a service provider in the `app.php` configuration file

```

```

3. Copy basic folder structure to app/Api `cp -R vendor/ddiimmkkaass/lumen-api-generator/templates/Api app/Api` and check what you got there. If you need you can use different paths later.

Usage
-----

[](#usage)

### Generator

[](#generator)

The only console command that is added is `artisan make:api `.

Imagine you need to create a rest api to list/create/update etc users from users table. To achieve that you need to do lots of boilerplate operations - create controller, transformer, set up needed routes.

`php artisan make:api User` does all the work for you.

1. You may have noticed that after installation you already have a routes file `app/Api/routes.php` which looks like that:

```
