From b15e8327765d04da91d256ff9dfb5be373d6a581 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Mon, 7 Jun 2021 18:15:26 +0200 Subject: [PATCH] - small changes for m : n relation between document and dataset_subjects tables --- app/Http/Controllers/Publish/IndexController.php | 2 +- .../2021_06_07_135923_create_dataset_subjects_table.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Publish/IndexController.php b/app/Http/Controllers/Publish/IndexController.php index 2639dbf..aa22100 100644 --- a/app/Http/Controllers/Publish/IndexController.php +++ b/app/Http/Controllers/Publish/IndexController.php @@ -482,7 +482,7 @@ class IndexController extends Controller // $dataKeyword = new Subject($keyword); // $dataset->subjects()->save($dataKeyword); $keyword = Subject::firstOrCreate( - ['value' => $keyword['value']], + ['value' => $keyword['value'], 'language' => $keyword['language']], $keyword ); $dataset->subjects()->attach($keyword); diff --git a/database/migrations/2021_06_07_135923_create_dataset_subjects_table.php b/database/migrations/2021_06_07_135923_create_dataset_subjects_table.php index 232afa3..dc87903 100644 --- a/database/migrations/2021_06_07_135923_create_dataset_subjects_table.php +++ b/database/migrations/2021_06_07_135923_create_dataset_subjects_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateDatasetSubjects extends Migration +class CreateDatasetSubjectsTable extends Migration { // php artisan make:migration create_dataset_subjects_table --table=dataset_subjects --create=dataset_subjects // php artisan migrate