Package Data | |
---|---|
Maintainer Username: | YanDatsyuk |
Maintainer Contact: | alex.storojenko@thinkmobiles.com (Alex Storojenko) |
Package Create Date: | 2017-05-17 |
Package Last Update: | 2019-06-14 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-26 15:04:13 |
Package Statistics | |
---|---|
Total Downloads: | 157 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 9 |
Total Watchers: | 4 |
Total Forks: | 4 |
Total Open Issues: | 12 |
Code scaffolding for REST API project by database schema. This package is available also on packagist. And installation via packagist is preferred way.
There are two open source REST API projects on GitHub, developed using this generator:
"tmphp/rest-api-generators": "dev-master"
to your composer.json (node "require"
)"minimum-stability": "dev"
in your composer.jsoncomposer update
Open your config/app.php
and add this line in providers
section
TMPHP\RestApiGenerators\GeneratorsServiceProviders::class,
Dingo\Api\Provider\LaravelServiceProvider::class,
Way\Generators\GeneratorsServiceProvider::class,
Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class,
Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class,
L5Swagger\L5SwaggerServiceProvider::class,
Abhijitghogre\LaravelDbClearCommand\LaravelDbClearCommandServiceProvider::class,
Felixkiss\UniqueWithValidator\ServiceProvider::class,
Execute command
php artisan vendor:publish
Open your config/jwt.php
and change line with a user's model namespace.
'user' => 'App\REST\User',
API_DOMAIN=yourdomain.dev
Add middleware to App/Http/Kernel.php to the $routeMiddleware array.
'check.role.access' => \TMPHP\RestApiGenerators\Middleware\CheckAccess::class,
Add '/routes' path in 'config/l5-swagger.php', annotation path.
'annotations' => [base_path('app'), base_path('routes')],
Make sure, that you have created database schema. For generating relations you should have FOREIGN KEY Constraints.
php artisan make:rest-api-project
php artisan l5-swagger:generate
composer dump-autoload