New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

laraveldaily/apigenerator

API Generator for Laravel 5
1,224 86

Larablocks Analysis

laraveldaily/apigenerator works with Laravel 5 (latest release 0.1.9, Dec 5, 2018), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: Dec 5, 2018)
  • 16 downloads a month (needs 10,000)
  • 86 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Dec 5, 2018.
  • No releases in the last 12 months.
  • First released: Jul 27, 2017.
  • Monthly downloads: 16.
  • 3 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 5, 2026.

Install
composer require laraveldaily/apigenerator
Latest Version:0.1.9
Laravel:5
License:MIT
Last Updated:Oct 10, 2019
Links: GitHub  ·  Packagist
Maintainer: Laraveldaily

API Generator for Laravel 5.4 and above

Package to create API Controller and Route entry with one Artisan command.

For now we're starting with only one simple command and will expand functionality as needed. Please submit your suggestions in Issues section.

Notice: if you want to generate not only API, but full admin panel - check out our QuickAdminPanel.com

Installation and Usage

  1. Install the package via composer require laraveldaily/apigenerator

  2. Add Laraveldaily\Apigenerator\ApiGeneratorProvider::class to your config\app.php providers.

  3. That's it: run php artisan make:api --model=XXXXX where XXXXX is your model name.

This command will generate API Controller and new entry in routes/api.php file.

Notice: Model should exist already, our package won't create it.

Example

php artisan make:api --model=Project

Will generate the file app\Http\Controllers\Api\ProjectsController.php:

<?php

namespace App\Http\Controllers\Api;

use App\Project;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class ProjectsController extends Controller
{
    public function index()
    {
        return Project::all();
    }

    public function store(Request $request)
    {
        $project = Project::create($request->all());

        return $project;
    }

    public function show($id)
    {
        return Project::findOrFail($id);
    }

    public function update(Request $request, $id)
    {
        $project = Project::findOrFail($id);
        $project->update($request->all());

        return $project;
    }

    public function destroy($id)
    {
        $project = Project::findOrFail($id);
        $project->delete();

        return '';
    }
}

And this line will be added to routes/api.php:

Route::resource('projects', 'Api/ProjectsController', ['except' => ['create', 'edit']]);

License

The MIT License (MIT). Please see License File for more information.


More from our LaravelDaily Team

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

438,010,529 4,660

Version History

Version Released Laravel License
0.1.9 5.4.*|5.5.*|5.6.*|5.7.* MIT
0.1.8 5.4.*|5.5.*|5.6.* MIT
0.1.7 5.4.*|5.5.*|5.6.* MIT
0.1.6 5.4.*|5.5.* MIT
0.1.5 5.4.* MIT