API Rest generator for Laravel Framework. Create your api resource in seconds using only your database table name or connection name.
composer require phfoxer/apigenerateInstall the service provider:
// config/app.php
'providers' => [
...
Phfoxer\ApiGenerate\ApiGenerateServiceProvider::class,
...
];To create all API Rest resources run this command (Only postgres and mysql):
php artisan generate:api --con=conection_nameTo create a new api resource run this command:
php artisan generate:api --table=table_name --relation=trueYou can see result in http://localhost:8000/api/table_name You can find your new resource in app/RestAPI. General is the default
To define route:
php artisan generate:api --table=table_name --route=my-custom-route --relation=trueTo define module name:
php artisan generate:api --table=table_name --route=my-custom-route --relation=trueYou can find your new resource in app/RestAPI/Exemple.
You are free to use this package as it's MIT-licensed