public function run() { DB::table('oauth2_api_endpoint_api_scope')->delete(); DB::table('oauth2_client_api_scope')->delete(); DB::table('oauth2_api_scope')->delete(); DB::table('oauth2_api')->delete(); $resource_server = ResourceServer::first(); // users Api::create(array('name' => 'users', 'logo' => null, 'active' => true, 'Description' => 'User Info', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); }
/** * Run the migrations. * * @return void */ public function up() { $resource_server = ResourceServer::first(); if (!$resource_server) { return; } // public clouds Api::create(array('name' => 'public-clouds', 'logo' => null, 'active' => true, 'Description' => 'Marketplace Public Clouds', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); // private clouds Api::create(array('name' => 'private-clouds', 'logo' => null, 'active' => true, 'Description' => 'Marketplace Private Clouds', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); // consultants Api::create(array('name' => 'consultants', 'logo' => null, 'active' => true, 'Description' => 'Marketplace Consultants', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); $this->seedPublicCloudScopes(); $this->seedPrivateCloudScopes(); $this->seedConsultantScopes(); $this->seedPublicCloudsEndpoints(); $this->seedPrivateCloudsEndpoints(); $this->seedConsultantsEndpoints(); }
/** * @param $config * @param $authorization * @return Api */ public function getApi($config, $authorization) { // TODO check if it exists (have some getter fn in parent Configuration) return Api::create($this->getYaml('/config.yml', 'parameters', 'api'), $config, $authorization); }
private function seedApis() { $resource_server = ResourceServer::first(); Api::create(array('name' => 'resource-server', 'logo' => null, 'active' => true, 'Description' => 'Resource Server CRUD operations', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); Api::create(array('name' => 'api', 'logo' => null, 'active' => true, 'Description' => 'Api CRUD operations', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); Api::create(array('name' => 'api-endpoint', 'logo' => null, 'active' => true, 'Description' => 'Api Endpoints CRUD operations', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); Api::create(array('name' => 'api-scope', 'logo' => null, 'active' => true, 'Description' => 'Api Scopes CRUD operations', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); Api::create(array('name' => 'users', 'logo' => null, 'active' => true, 'Description' => 'User Info', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); Api::create(array('name' => 'public-clouds', 'logo' => null, 'active' => true, 'Description' => 'Marketplace Public Clouds', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); Api::create(array('name' => 'private-clouds', 'logo' => null, 'active' => true, 'Description' => 'Marketplace Private Clouds', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); Api::create(array('name' => 'consultants', 'logo' => null, 'active' => true, 'Description' => 'Marketplace Consultants', 'resource_server_id' => $resource_server->id, 'logo' => asset('img/apis/server.png'))); }