add swagger build command

pull/1/head
Farid Saravi 5 years ago
parent 1dc5dc706a
commit e6116e9d12

@ -0,0 +1,43 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class BuildSwagger extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'swagger:build';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Build swagger api list.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$basePath = base_path();
exec("$basePath/vendor/bin/openapi --bootstrap $basePath/development/swagger-constants.php --output $basePath/public/swagger/swagger.json $basePath/development/swagger-v1.php $basePath/app/Http/Controllers $basePath/modules --format json");
}
}

@ -26,6 +26,9 @@ class Kernel extends ConsoleKernel
{
// $schedule->command('inspire')
// ->hourly();
// $schedule->call(function () {
// \DB::table('wmuser_common.comments')->limit(1)->delete();
// })->cron('*/2 * * * *')->sendOutputTo(storage_path('task.txt'));
}
/**

@ -18,6 +18,9 @@ class EventServiceProvider extends ServiceProvider
Registered::class => [
SendEmailVerificationNotification::class,
],
'Illuminate\Notifications\Events\NotificationSent' => [
'App\Listeners\LogNotification',
],
];
/**

Loading…
Cancel
Save