diff --git a/README.md b/README.md index b972a3ba..024962bf 100644 --- a/README.md +++ b/README.md @@ -88,13 +88,6 @@ Starting platform_web_server_1 ``` ./develop artisan migrate ``` - -- Create laravel passport oauth keys & db entries - -``` -./develop artisan passport:client --personal -./develop artisan passport:client --password -``` - You can also seed database with example data using this command diff --git a/composer.json b/composer.json index d50101c3..f6f398e1 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,6 @@ ], "post-create-project-cmd": [ "php artisan key:generate", - "php artisan passport:keys", "php artisan vendor:publish --tag=public --force --provider=\"Gzero\\Admin\\ServiceProvider\"" ], "post-install-cmd": [ diff --git a/database/migrations/2017_03_09_134604_passport_create_clients.php b/database/migrations/2017_03_09_134604_passport_create_clients.php new file mode 100644 index 00000000..0accb331 --- /dev/null +++ b/database/migrations/2017_03_09_134604_passport_create_clients.php @@ -0,0 +1,39 @@ + true, + '--name' => config('app.name') . ' Password Grant Client' + ]); + + Artisan::call('passport:client', [ + '--personal' => true, + '--name' => config('app.name') . ' Personal Access Client' + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + if (Schema::hasTable('oauth_clients')) { + $records = DB::table('oauth_clients') + ->where('name', 'like', config('app.name') . ' % Client') + ->delete(); + } + } +}