From 54edfb46176e6b3ef08d41f8d25de4fb3463a2a4 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Tue, 3 Sep 2019 17:43:56 +0200 Subject: [PATCH] - add ProjectsTableSeeder.php - project label: allow 10 chars --- app/Http/Requests/ProjectRequest.php | 2 +- ...019_08_28_083531_create_projects_table.php | 2 +- database/seeds/DatabaseSeeder.php | 1 + database/seeds/ProjectsTableSeeder.php | 26 +++++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 database/seeds/ProjectsTableSeeder.php diff --git a/app/Http/Requests/ProjectRequest.php b/app/Http/Requests/ProjectRequest.php index aa6f6fc..bf48563 100644 --- a/app/Http/Requests/ProjectRequest.php +++ b/app/Http/Requests/ProjectRequest.php @@ -25,7 +25,7 @@ class ProjectRequest extends Request return [ 'name' => 'required|min:3|max:255', - 'label' => 'required|min:3|max:10', + 'label' => 'required|min:3|max:20', 'description' => 'required' ]; } diff --git a/database/migrations/2019_08_28_083531_create_projects_table.php b/database/migrations/2019_08_28_083531_create_projects_table.php index 543ca45..46b3807 100644 --- a/database/migrations/2019_08_28_083531_create_projects_table.php +++ b/database/migrations/2019_08_28_083531_create_projects_table.php @@ -15,7 +15,7 @@ class CreateProjectsTable extends Migration { Schema::create('projects', function (Blueprint $table) { $table->increments('id'); - $table->string('label', 10); + $table->string('label', 20); $table->string('name', 255); $table->string('description', 255)->nullable(); $table->timestamps(); diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 863fd5d..059e112 100755 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -30,6 +30,7 @@ class DatabaseSeeder extends Seeder $this->call('LanguagesTableSeeder'); $this->call('PagesTableSeeder'); $this->call('CollectionsTableSeeder'); + $this->call('ProjectsTableSeeder'); $this->command->info('User table seeded!'); } } diff --git a/database/seeds/ProjectsTableSeeder.php b/database/seeds/ProjectsTableSeeder.php new file mode 100644 index 0000000..a3aea7b --- /dev/null +++ b/database/seeds/ProjectsTableSeeder.php @@ -0,0 +1,26 @@ +insert([ + [ + 'label' => 'ALLG_FACHLICH', + 'name' => 'Allgemein fachliche Arbeiten', + 'description' => 'Allgemein fachlich interdisziplinäre Arbeiten', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + ]); + } +}