first work on to do orders
This commit is contained in:
16
database/factories/ToDoItemFactory.php
Normal file
16
database/factories/ToDoItemFactory.php
Normal 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(),
|
||||
];
|
||||
});
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user