filters updated

This commit is contained in:
Benjamin Takats
2022-12-05 20:24:16 +01:00
parent e921132504
commit fd2dee5590
12 changed files with 90 additions and 11 deletions

View File

@@ -15,6 +15,8 @@ class CreateLibrariesTable extends Migration
Schema::create('libraries', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->boolean('is_public')
->default(true);
$table->json('language_codes')
->default('[]');
$table->timestamps();

View File

@@ -24,7 +24,8 @@ class CreateLibraryItemsTable extends Migration
$table->string('name');
$table->string('type');
$table->string('language_code');
$table->longText('value');
$table->longText('value')
->nullable();
$table->timestamps();
});

View File

@@ -254,11 +254,28 @@ class DatabaseSeeder extends Seeder
]);
$libraryItem = LibraryItem::create([
'lecturer_id' => 4,
'name' => 'Cryptography is Not Enough - Gigi @ Baltic Honeybadger 2022 ',
'name' => 'Cryptography is Not Enough - Gigi @ Baltic Honeybadger 2022 ',
'type' => 'youtube_video',
'language_code' => 'de',
'value' => 'https://www.youtube.com/watch?v=C7ynm0Zkwfk',
]);
$libraryItem->syncTagsWithType(['Proof of Work'], 'library_item');
$library->libraryItems()
->attach($libraryItem);
$nonPublicLibrary = Library::create([
'name' => 'Einundzwanzig Dozenten',
'is_public' => false,
'language_codes' => ['de', 'en'],
]);
$libraryItem = LibraryItem::create([
'lecturer_id' => 4,
'name' => 'Präsentation: Bitcoin VHS Kurs 2022',
'type' => 'downloadable_file',
'language_code' => 'de',
'value' => null,
]);
$libraryItem->syncTagsWithType(['Präsentationen'], 'library_item');
$nonPublicLibrary->libraryItems()
->attach($libraryItem);
}
}