- add ProjectsTableSeeder.php

- project label: allow 10 chars
This commit is contained in:
Arno Kaimbacher 2019-09-03 17:43:56 +02:00
parent 4b5136ab9b
commit 54edfb4617
4 changed files with 29 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class ProjectRequest extends Request
return [ return [
'name' => 'required|min:3|max:255', 'name' => 'required|min:3|max:255',
'label' => 'required|min:3|max:10', 'label' => 'required|min:3|max:20',
'description' => 'required' 'description' => 'required'
]; ];
} }

View File

@ -15,7 +15,7 @@ class CreateProjectsTable extends Migration
{ {
Schema::create('projects', function (Blueprint $table) { Schema::create('projects', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('label', 10); $table->string('label', 20);
$table->string('name', 255); $table->string('name', 255);
$table->string('description', 255)->nullable(); $table->string('description', 255)->nullable();
$table->timestamps(); $table->timestamps();

View File

@ -30,6 +30,7 @@ class DatabaseSeeder extends Seeder
$this->call('LanguagesTableSeeder'); $this->call('LanguagesTableSeeder');
$this->call('PagesTableSeeder'); $this->call('PagesTableSeeder');
$this->call('CollectionsTableSeeder'); $this->call('CollectionsTableSeeder');
$this->call('ProjectsTableSeeder');
$this->command->info('User table seeded!'); $this->command->info('User table seeded!');
} }
} }

View File

@ -0,0 +1,26 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class ProjectsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('projects')->insert([
[
'label' => 'ALLG_FACHLICH',
'name' => 'Allgemein fachliche Arbeiten',
'description' => 'Allgemein fachlich interdisziplinäre Arbeiten',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
]);
}
}