first work on to do orders

This commit is contained in:
2020-04-24 08:10:54 +02:00
parent c6b94aa1f1
commit 0c89550dfe
6 changed files with 163 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Models\ToDo;
use Faker\Generator as Faker;
$factory->define(ToDo::class, function (Faker $faker) {
$toDoList = factory(\App\Models\ToDoList::class);
return [
'to_do_list_id' => $toDoList,
'name' => $faker->words(3, [false]),
// 'order' => $toDoList->toDos->orderBy('id', 'desc')->first()->order + 1,
// 'checket_at' => now(),
];
});

View File

@@ -17,7 +17,7 @@ class CreateToDosTable extends Migration
$table->id();
$table->unsignedBigInteger('to_do_list_id');
$table->string('name');
$table->integer('order')->default(0);
$table->integer('order')->default(1);
$table->timestamp('checked_at')->nullable();
$table->timestamps();
});