rodrixcornell / apigenerate
Easy api generate for the Laravel Framework.
v1.1.0
2022-03-01 23:56 UTC
Requires
- php: ^7.4|^8.0
- doctrine/dbal: ^3
This package is auto-updated.
Last update: 2025-08-25 17:34:59 UTC
README
API Rest generator for Laravel Framework. Create your api resource in seconds using only your database table name or connection name.
Installation
"require-dev": { ... "rodrixcornell/apigenerate": "dev-master", ... }, "repositories": [{ "type": "vcs", "url": "https://github.com/rodrixcornell/laravel-api-generate.git" }],
composer update
composer require rodrixcornell/apigenerate --dev
Install the service provider:
// app/Providers/AppServiceProvider.php public function register() { if ($this->app->environment() !== 'production') { $this->app->register(\Rodrixcornell\ApiGenerate\ApiGenerateServiceProvider::class); } }
Usage
Creating a new resource
To create all API Rest resources run this command (Only postgres and mysql):
php artisan api:generate --con=conection_name
To create a new api resource run this command:
php artisan api:generate --table=table_name --relation=true
You can see result in http://localhost:8000/api/table_name You can find your new resource in app/Modules/General. General is the default
Params
To define route:
php artisan api:generate --table=table_name --route=my-custom-route --relation=true
To define module name:
php artisan api:generate --table=table_name --route=my-custom-route --module=Exemple --relation=true
You can find your new resource in app/Modules/Exemple.
Postcardware
You are free to use this package as it's MIT-licensed