From fcae6b5f15f9edb3bb4bf2f2dcbbcb65b85869d3 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 14 Sep 2016 15:19:59 -0400 Subject: [PATCH] remove required default value, update descriptions in seeder --- app/Repositories/ServiceRepository/Variable.php | 4 ++-- database/seeds/MinecraftServiceTableSeeder.php | 1 + database/seeds/SourceServiceTableSeeder.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Repositories/ServiceRepository/Variable.php b/app/Repositories/ServiceRepository/Variable.php index aa8419583..0ea372f45 100644 --- a/app/Repositories/ServiceRepository/Variable.php +++ b/app/Repositories/ServiceRepository/Variable.php @@ -100,7 +100,7 @@ class Variable 'name' => 'sometimes|required|string|min:1|max:255', 'description' => 'sometimes|required|string', 'env_variable' => 'sometimes|required|regex:/^[\w]{1,255}$/', - 'default_value' => 'sometimes|required|string|max:255', + 'default_value' => 'sometimes|string|max:255', 'user_viewable' => 'sometimes|required|numeric|size:1', 'user_editable' => 'sometimes|required|numeric|size:1', 'required' => 'sometimes|required|numeric|size:1', @@ -114,7 +114,7 @@ class Variable $data['default_value'] = (isset($data['default_value'])) ? $data['default_value'] : $variable->default_value; $data['regex'] = (isset($data['regex'])) ? $data['regex'] : $variable->regex; - if (!preg_match($data['regex'], $data['default_value'])) { + if ($data['default_value'] !== '' && !preg_match($data['regex'], $data['default_value'])) { throw new DisplayException('The default value you entered cannot violate the regex requirements.'); } diff --git a/database/seeds/MinecraftServiceTableSeeder.php b/database/seeds/MinecraftServiceTableSeeder.php index 0ac76947c..e69720a1c 100644 --- a/database/seeds/MinecraftServiceTableSeeder.php +++ b/database/seeds/MinecraftServiceTableSeeder.php @@ -58,6 +58,7 @@ class MinecraftServiceTableSeeder extends Seeder $this->service = Models\Service::create([ 'author' => 'ptrdctyl-v040-11e6-8b77-86f30ca893d3', 'name' => 'Minecraft', + 'description' => 'Minecraft - the classic game from Mojang. With support for Vanilla MC, Spigot, and many others!', 'file' => 'minecraft', 'executable' => 'java', 'startup' => '-Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}' diff --git a/database/seeds/SourceServiceTableSeeder.php b/database/seeds/SourceServiceTableSeeder.php index 210e1ba4d..5b2646ca9 100644 --- a/database/seeds/SourceServiceTableSeeder.php +++ b/database/seeds/SourceServiceTableSeeder.php @@ -58,6 +58,7 @@ class SourceServiceTableSeeder extends Seeder $this->service = Models\Service::create([ 'author' => 'ptrdctyl-v040-11e6-8b77-86f30ca893d3', 'name' => 'Source Engine', + 'description' => 'Includes support for most Source Dedicated Server games.', 'file' => 'srcds', 'executable' => './srcds_run', 'startup' => '-game {{SRCDS_GAME}} -console -port {{SERVER_PORT}} -strictportbind -norestart'