PHPackages                             raviyatechnical/laravel-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. [CLI &amp; Console](/categories/cli)
4. /
5. raviyatechnical/laravel-api-generator

ActiveLibrary[CLI &amp; Console](/categories/cli)

raviyatechnical/laravel-api-generator
=====================================

Generate Laravel API

117[1 issues](https://github.com/raviyatechnical/laravel-api-generator/issues)PHP

Since Aug 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/raviyatechnical/laravel-api-generator)[ Packagist](https://packagist.org/packages/raviyatechnical/laravel-api-generator)[ RSS](/packages/raviyatechnical-laravel-api-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

 [![Logo](https://camo.githubusercontent.com/78b2dea84560101d2fa6fb87affe4484f0f44ee388df01d5da980cee071ee77f/68747470733a2f2f7777772e72616a746563686e6f6c6f676965732e636f6d2f75692f696d616765732f72616a2d746563686e6f6c6f676965732d6c6f676f2d746f702d70616e656c2e6a7067)](https://camo.githubusercontent.com/78b2dea84560101d2fa6fb87affe4484f0f44ee388df01d5da980cee071ee77f/68747470733a2f2f7777772e72616a746563686e6f6c6f676965732e636f6d2f75692f696d616765732f72616a2d746563686e6f6c6f676965732d6c6f676f2d746f702d70616e656c2e6a7067)Laravel API Generator
=====================

[](#laravel-api-generator)

 Quickly generate rest api for your projects! with API Response Helpers

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

[](#installation)

Require the Laravel Repository Generator with composer.

```
composer require raviyatechnical/laravel-api-generator:dev-master --dev

```

Usage
-----

[](#usage)

For usage take the following steps. Generate the api controller and base controller.

### Generating BaseController With Auth (Laravel Sanctum)

[](#generating-basecontroller-with-auth-laravel-sanctum)

WARNING make you sure that file not exits it is overwrite file

Run the following command.

```
php artisan api:install --auth

```

This will generate the following files:

```
App\Http\Controllers\API\BaseController
App\Http\Controllers\API\Auth\LoginController.php
App\Http\Controllers\API\Auth\RegisterController.php
App\Http\Resources\AuthResource.php

```

Add Route On This Path: routes/web.php

```
use App\Http\Controllers\API\Auth\LoginController;
use App\Http\Controllers\API\Auth\RegisterController;
...
Route::post('register', [RegisterController::class, 'register'])->name('auth.register');
Route::post('login', [LoginController::class, 'login'])->name('auth.login');
Route::post('logout', [LoginController::class, 'logout'])->name('auth.logout')->middleware('auth:sanctum');
Route::post('logout-all', [LoginController::class, 'logoutAll'])->name('auth.logout.all')->middleware('auth:sanctum');

```

### Generating BaseController Without Auth

[](#generating-basecontroller-without-auth)

WARNING make you sure that file not exits it is overwrite file

Run the following command.

```
php artisan api:install

```

This will generate the following files:

```
App\Http\Controllers\API\BaseController

```

### Generating API Controller

[](#generating-api-controller)

Run the following command.

```
php artisan api:controller UserController

```

This example will generate the following files:

```
App\Http\Controllers\API\UserController

```

Tech Stack
----------

[](#tech-stack)

**Server:** Laravel API

Authors
-------

[](#authors)

- [@bhargavraviya](https://github.com/bhargavraviya)

Support
-------

[](#support)

For support, email .

🔗 Links
-------

[](#-links)

[![portfolio](https://camo.githubusercontent.com/ee59c11a0ffcc301e7d0b1201866923b89c43bfd5701d3a45eef9372794dc301/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d795f706f7274666f6c696f2d3030303f7374796c653d666f722d7468652d6261646765266c6f676f3d6b6f2d6669266c6f676f436f6c6f723d7768697465)](https://raviyatechnical.medium.com)[![linkedin](https://camo.githubusercontent.com/9745a59ad4a919d2e524512c3f732c820d4aa0fe927def4f37c4aba08f7e42bc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c696e6b6564696e2d3041363643323f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e266c6f676f436f6c6f723d7768697465)](https://www.linkedin.com/company/raviyatechnical)[![twitter](https://camo.githubusercontent.com/79cbea7e1aa9ec614d34050bdc4128542d8527807ac8ce879f953ced3478375d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f747769747465722d3144413146323f7374796c653d666f722d7468652d6261646765266c6f676f3d74776974746572266c6f676f436f6c6f723d7768697465)](https://twitter.com/raviyatechnical)

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

10

—

LowBetter than 0% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/484d8853ed6af9e62e0170e999ae07b1e827d31aca601953f3e0fc81286799a0?d=identicon)[raviyatechnical](/maintainers/raviyatechnical)

---

Top Contributors

[![bhargavraviya](https://avatars.githubusercontent.com/u/46953122?v=4)](https://github.com/bhargavraviya "bhargavraviya (9 commits)")[![raviyatechnical](https://avatars.githubusercontent.com/u/57633859?v=4)](https://github.com/raviyatechnical "raviyatechnical (1 commits)")

---

Tags

apiapi-authapi-authenticationapi-controllerapi-restartisancligeneratorlaravellaravel-api-responselaravel-api-response-helpers

### Embed Badge

![Health badge](/badges/raviyatechnical-laravel-api-generator/health.svg)

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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