rodrixcornell/apigenerate
Composer 安装命令:
composer require rodrixcornell/apigenerate
包简介
Easy api generate for the Laravel Framework.
README 文档
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
统计信息
- 总下载量: 99
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-28