APIs Created by: Sam Poyigi


Manages and generates RESTful APIs using available models

1 week ago
10 months ago
Sam Poyigi
 Public repository

Views: 1684

Support the author with a donation.


APIs is an extension that allows you to build RESTful APIs and manage them within a TastyIgniter application.

However, it accomplishes more than just that, you may override the api actions (verbs) with your own logic. Default behavior logic for several common verbs are supported — create, store, show, edit, update, destroy.


  • Auto Generate Controller (CRUD)
  • Auto Generate Resource Response Class (For modeling JSON response)
  • Support relationships


  • User Authentication (with Laravel Passport)
  • Generating User Tokens


To install this extension, click on the Add to Site button on the marketplace item page or search for Igniter.Api in **Admin System > Updates > Browse Extensions***


In the admin user interface, go to Tools > APIs and use the Create button to generate a new api resource

Manually Create an API resource

The below command will generate both Controller and Resource Transformer for the specified resource

php artisan create:apiresource Acme.Extension ResourceName

After the resource has been generated, add it to routes by registering a new api resource.

Register API Resource

public function registerApiResources()
    return [
        'menus' => [
            'name' => 'Menus',
            'description' => 'Description of this API resource',
            'controller' => \Acme\Extension\ApiResources\Menus::class,
            'transformer' => \Acme\Extension\ApiResources\Transformers\MenuTransformer::class,

The array keys represents the resource endpoints

Resource Transformer

Response are transformed using laravel's eloquent resources.

Example of Resource Transformer

<?php namespace Igniter\Local\ApiResources\Transformers;

use Illuminate\Http\Resources\Json\Resource;

class MenuTransformer extends Resource
    public function toArray($request)
        return [
            'id'      => (int) $this->menu_id,
            'name'    => $this->menu_name,
            'links'   => [
                    'rel' => 'self',
                    'uri' => '/api/menus/'.$this->menu_id,


  1.   Latest release

    Minor improvements

  2. v0.1.0-beta.8

    Minor improvements

  3. v0.1.0-beta.7

    Minor changes

  4. v0.1.0-beta.6