diff --git a/src/app/Enums/ItemTypes.php b/src/app/Enums/ItemTypes.php new file mode 100644 index 0000000..c8c32da --- /dev/null +++ b/src/app/Enums/ItemTypes.php @@ -0,0 +1,42 @@ + 'Book', + static::movie => 'Movie', + static::game => 'Game', + static::music => 'Music', + static::ebook => 'Ebook', + static::audiobook => 'Audiobook', + static::magazine => 'Magazine', + }; + } + + public function internal(): string + { + $match = match ($this) { + static::book => 'book', + static::movie => 'movie', + static::game => 'game', + static::music => 'music', + static::ebook => 'ebook', + static::audiobook => 'audiobook', + static::magazine => 'magazine', + }; + + return strtoupper($match); + } +} diff --git a/src/database/seeders/ItemSeeder.php b/src/database/seeders/ItemSeeder.php new file mode 100644 index 0000000..5426f60 --- /dev/null +++ b/src/database/seeders/ItemSeeder.php @@ -0,0 +1,72 @@ + $rating, + 'modified_user' => User::where('email', 'superadmin@biblio.nl')->first()->id, + 'modified_kind' => 'I', + ]); + } + + // CATEGORIES + $categories = [ + "Action", + "Adventure", + "Animation", + "Biography", + "Comedy", + "Crime", + "Documentary", + "Drama", + "Family", + "Fantasy", + "Film-Noir", + "History", + "Horror", + "Music", + "Musical", + "Mystery", + "Romance", + "Sci-Fi", + "Sport", + "Thriller", + "War", + "Western", + ]; + + foreach ($categories as $category) { + ItemCategory::create([ + 'category' => $category, + 'modified_user' => User::where('email', 'superadmin@biblio.nl')->first()->id, + 'modified_kind' => 'I' + ]); + } + } +}