diff --git a/app/Http/Controllers/StatisticController.php b/app/Http/Controllers/StatisticController.php index 27ed05d..ae65111 100644 --- a/app/Http/Controllers/StatisticController.php +++ b/app/Http/Controllers/StatisticController.php @@ -43,7 +43,7 @@ class StatisticController extends Controller $this->addSystems($result, $task); - $this->addTags($result, $task, $tags[$task->id]); + $this->addTags($result, $task, $tags[$task->id] ?? []); } return $result; diff --git a/database/migrations/2020_08_18_085114_create_tags_table.php b/database/migrations/2020_08_18_085114_create_tags_table.php index 39a8e9b..6c00987 100644 --- a/database/migrations/2020_08_18_085114_create_tags_table.php +++ b/database/migrations/2020_08_18_085114_create_tags_table.php @@ -23,8 +23,10 @@ class CreateTagsTable extends Migration }); Schema::create('tag_task', function (Blueprint $table) { + $table->id(); $table->unsignedBigInteger('tag_id'); $table->unsignedBigInteger('task_id'); + $table->timestamps(); }); }