From 4003c05338d38c5b69e30819c9854fb40a81bf19 Mon Sep 17 00:00:00 2001 From: mahdihty Date: Wed, 3 Mar 2021 16:26:48 +0330 Subject: [PATCH] some bug fix --- app/Http/Controllers/StatisticController.php | 2 +- database/migrations/2020_08_18_085114_create_tags_table.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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(); }); }