first work on To Do Lists

This commit is contained in:
2020-04-19 22:46:28 +02:00
parent c71f3ca4d8
commit c6b94aa1f1
17 changed files with 710 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Models\ToDoList;
use Faker\Generator as Faker;
$factory->define(ToDoList::class, function (Faker $faker) {
return [
'user_id' => factory(\App\User::class),
'name' => $faker->words(3, [false]),
];
});

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateToDoListsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('to_do_lists', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id');
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('to_do_lists');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateToDosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('to_dos', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('to_do_list_id');
$table->string('name');
$table->integer('order')->default(0);
$table->timestamp('checked_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('to_dos');
}
}