/** * Seed the projects table. * * @return void */ protected function seedProjects() { $defaultProjects = [['name' => 'API', 'description' => 'Used by third-parties to connect to us', 'status' => 1, 'order' => 0, 'team_id' => 0, 'slug' => 'Gitamin'], ['name' => 'Documentation', 'description' => 'Kindly powered by Readme.io', 'status' => 1, 'order' => 0, 'team_id' => 1, 'slug' => 'Baidu'], ['name' => 'Website', 'description' => '', 'status' => 1, 'order' => 0, 'team_id' => 1, 'slug' => 'Alibaba'], ['name' => 'Blog', 'description' => 'The Gitamin Blog.', 'status' => 1, 'order' => 0, 'team_id' => 1, 'slug' => 'Tencent']]; Project::truncate(); foreach ($defaultProjects as $project) { Project::create($project); } }
/** * Seed the projects table. */ protected function seedProjects() { $defaultProjects = [['name' => 'API', 'description' => 'Used by third-parties to connect to us', 'visibility_level' => 0, 'owner_id' => 1, 'creator_id' => 1, 'path' => 'api'], ['name' => 'Documentation', 'description' => 'Kindly powered by Readme.io', 'visibility_level' => 1, 'owner_id' => 2, 'creator_id' => 1, 'path' => 'doc'], ['name' => 'Website', 'description' => 'Tencent Holdings Limited is a Chinese investment holding company', 'visibility_level' => 1, 'owner_id' => 3, 'creator_id' => 1, 'path' => 'website'], ['name' => 'Blog', 'description' => 'The Gitamin Blog.', 'visibility_level' => 1, 'owner_id' => 4, 'creator_id' => 1, 'path' => 'blog']]; Project::truncate(); foreach ($defaultProjects as $project) { Project::create($project); } }
/** * Handle the add project command. * * @param \Gitamin\Commands\Project\AddProjectCommand $command * * @return \Gitamin\Models\Project */ public function handle(AddProjectCommand $command) { $project = Project::create($this->filter($command)); event(new ProjectWasAddedEvent($project)); return $project; }