diff --git a/app/Models/Document.php b/app/Models/Document.php index 352b605a..5714cd4d 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -298,40 +298,6 @@ class Document extends Model implements TranslatableModel return $data; } - // * RELATIONSHIPS - - /** - * Relation to Tag - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function tags(): \Illuminate\Database\Eloquent\Relations\BelongsToMany - { - return $this->morphedByMany( - DocumentTag::class, - 'documentable', - 'documentables', - 'document_id', - 'documentable_id' - )->withTimestamps(); - } - - /** - * Relation to Category - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany - { - return $this->morphedByMany( - DocumentCategory::class, - 'documentable', - 'documentables', - 'document_id', - 'documentable_id' - )->withTimestamps(); - } - public function inertiaFill(array $attributes) { // j'extrait issuPath et j'applique un traitement ensuite. @@ -370,4 +336,38 @@ class Document extends Model implements TranslatableModel ); }); } + + // * RELATIONSHIPS + + /** + * Relation to Tag + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany + */ + public function tags(): \Illuminate\Database\Eloquent\Relations\BelongsToMany + { + return $this->morphedByMany( + DocumentTag::class, + 'documentable', + 'documentables', + 'document_id', + 'documentable_id' + )->withTimestamps(); + } + + /** + * Relation to Category + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany + */ + public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany + { + return $this->morphedByMany( + DocumentCategory::class, + 'documentable', + 'documentables', + 'document_id', + 'documentable_id' + )->withTimestamps(); + } } diff --git a/database/factories/CompanyActivityFactory.php b/database/factories/CompanyActivityFactory.php new file mode 100644 index 00000000..ad54f07a --- /dev/null +++ b/database/factories/CompanyActivityFactory.php @@ -0,0 +1,29 @@ + + */ +class CompanyActivityFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + "name" => $this->faker->unique()->words( + $this->faker->numberBetween(3, 4), + true + ), + "color" => $this->faker->hexColor(), + "published" => $this->faker->boolean(50), + ]; + } +} diff --git a/database/factories/CompanyFactory.php b/database/factories/CompanyFactory.php index 5fda6d51..a4974a8a 100644 --- a/database/factories/CompanyFactory.php +++ b/database/factories/CompanyFactory.php @@ -8,6 +8,9 @@ use App\Models\CompanySector; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; +/** + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Company> + */ class CompanyFactory extends Factory { /** @@ -21,7 +24,7 @@ class CompanyFactory extends Factory $companySectorModel = fake()->randomElement(CompanySector::all()); return [ - 'name' => fake()->company(), + 'name' => fake()->unique()->company(), 'responsable' => fake()->name(), 'informations' => fake()->text(200), 'latitude' => fake()->latitude(), diff --git a/database/factories/CompanySectorFactory.php b/database/factories/CompanySectorFactory.php new file mode 100644 index 00000000..9c8afb13 --- /dev/null +++ b/database/factories/CompanySectorFactory.php @@ -0,0 +1,28 @@ + + */ +class CompanySectorFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + "name" => $this->faker->unique()->words( + $this->faker->numberBetween(3, 4), + true + ), + "published" => $this->faker->boolean(50), + ]; + } +} diff --git a/database/factories/DocumentCategoryFactory.php b/database/factories/DocumentCategoryFactory.php index 47a78009..e63813c0 100644 --- a/database/factories/DocumentCategoryFactory.php +++ b/database/factories/DocumentCategoryFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Str; /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DocumentCategory> @@ -16,8 +17,12 @@ class DocumentCategoryFactory extends Factory */ public function definition(): array { + $name = $this->faker->unique()->word(); + $slug = Str::slug($name); + return [ - 'name' => $this->faker->unique()->word(), + 'name' => $name, + 'slug' => $slug, ]; } } diff --git a/database/factories/DocumentFactory.php b/database/factories/DocumentFactory.php index e8ed9471..f8938b51 100644 --- a/database/factories/DocumentFactory.php +++ b/database/factories/DocumentFactory.php @@ -10,42 +10,23 @@ use App\Models\DocumentTag; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; +/** + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Document> + */ class DocumentFactory extends Factory { - protected $model = Document::class; - + /** + * Define the model's default state. + * + * @return array + */ public function definition(): array { - $title = $this->faker->sentence(3); return [ - 'name' => $title, - 'path' => 'documents/' . Str::slug($title) . '.pdf', - 'exercice' => $this->faker->randomElement(YearsEnum::cases()), - 'status' => $this->faker->randomElement(DocumentStatusEnum::cases()), - 'published_at' => $this->faker->dateTimeBetween('-1 month', 'now'), - 'unpublished_at' => null, + 'name' => $this->faker->sentence(3), + 'exercice' => $this->faker->randomElement(YearsEnum::cases()), + 'status' => $this->faker->randomElement(DocumentStatusEnum::cases()), + 'published_at' => $this->faker->dateTimeBetween('-1 month', 'now'), ]; } - - /** - * Ajoute automatiquement des tags à un document créé. - */ - public function withTags(int $count = 3): static - { - return $this->afterCreating(function (Document $document) use ($count) { - $tags = DocumentTag::factory()->count($count)->create(); - $document->tags()->sync($tags->pluck('id')); - }); - } - - /** - * Ajoute automatiquement des tags à un document créé. - */ - public function withCategories(int $count = 3): static - { - return $this->afterCreating(function (Document $document) use ($count) { - $cats = DocumentCategory::factory()->count($count)->create(); - $document->categories()->sync($cats->pluck('id')); - }); - } } diff --git a/database/factories/DocumentTagFactory.php b/database/factories/DocumentTagFactory.php index 43c14a0b..48d82590 100644 --- a/database/factories/DocumentTagFactory.php +++ b/database/factories/DocumentTagFactory.php @@ -2,17 +2,27 @@ namespace Database\Factories; -use App\Models\DocumentTag; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Str; +/** + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DocumentTag> + */ class DocumentTagFactory extends Factory { - protected $model = DocumentTag::class; - + /** + * Define the model's default state. + * + * @return array + */ public function definition(): array { + $name = $this->faker->unique()->word(); + $slug = Str::slug($name); + return [ - 'name' => $this->faker->unique()->word(), + 'name' => $name, + 'slug' => $slug, ]; } } diff --git a/database/factories/DynamicPageFactory.php b/database/factories/DynamicPageFactory.php index 8d63ca21..37a427b3 100644 --- a/database/factories/DynamicPageFactory.php +++ b/database/factories/DynamicPageFactory.php @@ -10,6 +10,9 @@ use App\Models\PageConfig; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; +/** + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DynamicPage> + */ class DynamicPageFactory extends Factory { /** diff --git a/database/factories/NewsCategoryFactory.php b/database/factories/NewsCategoryFactory.php index 32d9dfb2..36e878a0 100644 --- a/database/factories/NewsCategoryFactory.php +++ b/database/factories/NewsCategoryFactory.php @@ -3,9 +3,10 @@ namespace Database\Factories; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Str; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\News> + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\NewsCategory> */ class NewsCategoryFactory extends Factory { @@ -16,9 +17,12 @@ class NewsCategoryFactory extends Factory */ public function definition(): array { + $name = $this->faker->unique()->word(); + $slug = Str::slug($name); + return [ - "name" => $this->faker->unique()->word(), - "slug" => $this->faker->unique()->word(), + "name" => $name, + "slug" => $slug, ]; } } diff --git a/database/factories/NewsTagFactory.php b/database/factories/NewsTagFactory.php index 02fb2cfa..413f8b1c 100644 --- a/database/factories/NewsTagFactory.php +++ b/database/factories/NewsTagFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Str; /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\NewsTag> @@ -16,10 +17,13 @@ class NewsTagFactory extends Factory */ public function definition(): array { + $name = $this->faker->unique()->word(); + $slug = Str::slug($name); + return [ - "name" => $this->faker->unique()->word(), - "slug" => $this->faker->unique()->word(), - "color" => "#fff" + "name" => $name, + "slug" => $slug, + "color" => $this->faker->hexColor(), ]; } } diff --git a/database/factories/PageConfigFactory.php b/database/factories/PageConfigFactory.php index 92e2fc91..558b4eb6 100644 --- a/database/factories/PageConfigFactory.php +++ b/database/factories/PageConfigFactory.php @@ -7,12 +7,15 @@ use App\Models\PageConfig; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; +/** + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PageConfig> + */ class PageConfigFactory extends Factory { /** * Define the model's default state. * - * @return array + * @return array */ public function definition(): array { diff --git a/database/seeders/CompanyActivitySeeder.php b/database/seeders/CompanyActivitySeeder.php new file mode 100644 index 00000000..33e1dfc7 --- /dev/null +++ b/database/seeders/CompanyActivitySeeder.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/CompanySectorSeeder.php b/database/seeders/CompanySectorSeeder.php new file mode 100644 index 00000000..5949f191 --- /dev/null +++ b/database/seeders/CompanySectorSeeder.php @@ -0,0 +1,19 @@ +create(); + } +} diff --git a/database/seeders/CustomSeeder.php b/database/seeders/CustomSeeder.php new file mode 100644 index 00000000..5f09bf62 --- /dev/null +++ b/database/seeders/CustomSeeder.php @@ -0,0 +1,282 @@ +companyActivitySeeder(); + $this->companySectorSeeder(); + $this->documentCategorySeeder(); + $this->documentTagSeeder(); + } + + /** + * Set custom company activity seeder. + * + * @return void + */ + private function companyActivitySeeder(): void + { + // Set FR values. + app()->setLocale("fr"); + $firstActivity = CompanyActivity::create([ + "name" => "Amont", + "color" => "#6fbc45", + "published" => 1, + ]); + $secondActivity = CompanyActivity::create([ + "name" => "International", + "color" => "#b24881", + "published" => 1, + ]); + $thirdActivity = CompanyActivity::create([ + "name" => "Plateformes", + "color" => "#6d6d6d", + "published" => 1, + ]); + $fourthActivity = CompanyActivity::create([ + "name" => "Traiteur", + "color" => "#f29100", + "published" => 1, + ]); + $fifthActivity = CompanyActivity::create([ + "name" => "Volaille", + "color" => "#DC2034", + "published" => 1, + ]); + + // Set EN values. + app()->setLocale("en"); + $firstActivity->update([ + "name" => "Upstream", + ]); + $secondActivity->update([ + "name" => "International", + ]); + $thirdActivity->update([ + "name" => "Platforms", + ]); + $fourthActivity->update([ + "name" => "Catering", + ]); + $fifthActivity->update([ + "name" => "Poultry", + ]); + + // Set locale to the fallback. + app()->setLocale(config('app.fallback_locale')); + } + + /** + * Set custom company sector seeder. + * + * @return void + */ + private function companySectorSeeder(): void + { + collect([ + "Allemagne - ECF - Clements BETTERMANN", + "Angleterre - Capestone - Rob Cumine", + "Belgique - Kiplama - Toon KWEENS", + "Hongrie et Roumanie - Ákos Szabó", + "Pologne - Adam Sojka", + "Pôle Amont - Filière Céréales - Gaël Le Conte", + "Pôle Amont - Filière Oeufs - Christophe Bériard", + "Pôle Amont - Filière Spécialités - Didier Richard", + "Pôle Amont - Filière Vif - Stéphane Landreau", + "Pôle Amont - Filière accouvage - Olivier Sionneau", + "Pôle Traiteur - Crêpes et galettes - Christèle Lucas", + "Pôle Traiteur - La Toque Angevine - Pierre Lonjon", + "Pôle Traiteur - Pizzas, tartes, sandwiches et quiches - Yann Gomez", + "Pôle Traiteur - Plats cuisinés : Marie, Traditions d’Asie, Weight Watchers - Guillaume LETENNEUR", + "Pôle Traiteur - Plats cuisinés et produits exotiques - Benjamin Montlahuc", + "Pôle Traiteur - Restauration Hors Domicile - Ludovic Courtier", + "Pôle Traiteur - Surgelés - Didier Gand", + "Pôle Volaille - Cailles Robin - Guy Prod’homme", + "Pôle Volaille - GPA Distribution Paris - Thierry Lambert", + "Pôle Volaille - Hauts de France", + "Pôle Volaille - LDC Aquitaine - Denis Bordes", + "Pôle Volaille - LDC Foods - Mickaël Rio", + "Pôle Volaille - LDC TERRAVENIR - Christophe Pajot", + "Pôle Volaille - PFC - Dominique Théreau", + "Pôle Volaille - Société Arrivé - Roland Tonarelli", + "Pôle Volaille - Société Bretonne de Volaille - Laurent Girard", + "Pôle Volaille - Société Favreau Couthouis - Roland Tonarelli", + "Pôle Volaille - VOLENA - Arnaud Boinard", + "Pôle volaille - Pôle VDR - Philippe Aubert", + ])->map(function (string $sector) { + CompanySector::create([ + "name" => $sector, + "published" => 1, + ]); + }); + } + + /** + * Set custom document category seeder. + * + * @return void + */ + private function documentCategorySeeder(): void + { + // Set FR values. + app()->setLocale("fr"); + $docs = DocumentCategory::create([ + "name" => "Documents", + "slug" => "documents" + ]); + $meetings = DocumentCategory::create([ + "name" => "Assemblées générales", + "slug" => "assemblees-generales" + ]); + $investors = DocumentCategory::create([ + "name" => "Présentation investisseurs", + "slug" => "presentation-investisseurs" + ]); + $press = DocumentCategory::create([ + "name" => "Espace presse", + "slug" => "espace-presse" + ]); + + // Set EN values. + app()->setLocale("en"); + $docs->update([ + "name" => "Documents", + "slug" => "documents" + ]); + $meetings->update([ + "name" => "General meetings", + "slug" => "general-meetings" + ]); + $investors->update([ + "name" => "Investor presentation", + "slug" => "investor-presentation" + ]); + $press->update([ + "name" => "Meetings Press area", + "slug" => "meeting-press-area" + ]); + + // Set locale to the fallback. + app()->setLocale(config('app.fallback_locale')); + } + + /** + * Set custom document tag seeder. + * + * @return void + */ + private function documentTagSeeder(): void + { + // Set FR values. + app()->setLocale("fr"); + $communique = DocumentTag::create([ + "name" => "Communiqués et Avis financiers", + "slug" => "communiques-et-avis-financiers" + ]); + $semestriel = DocumentTag::create([ + "name" => "Rapports financiers annuels et semestriels", + "slug" => "rapports-financiers-annuels-et-semestriels" + ]); + $droitdevote = DocumentTag::create([ + "name" => "Déclaration mensuelles du nombre d’actions et de droits de vote", + "slug" => "declaration-mensuelles-du-nombre-dactions-et-de-droits-de-vote" + ]); + $rachat = DocumentTag::create([ + "name" => "Descriptif de programme de rachats d’actions", + "slug" => "descriptif-de-programme-de-rachats-dactions" + ]); + $liquidite = DocumentTag::create([ + "name" => "Opérations sur contrat de liquidité", + "slug" => "operations-sur-contrat-de-liquidite" + ]); + $trimestriel = DocumentTag::create([ + "name" => "Information Trimestrielle", + "slug" => "information-trimestrielle" + ]); + $publication = DocumentTag::create([ + "name" => "Publication", + "slug" => "publication" + ]); + $finance = DocumentTag::create([ + "name" => "Finance", + "slug" => "finance" + ]); + $general = DocumentTag::create([ + "name" => "Assemblée générale des actionnaires", + "slug" => "assemblee-generale-des-actionnaires" + ]); + $declaration = DocumentTag::create([ + "name" => "Déclaration des rachats d’actions", + "slug" => "declaration-des-rachats-dactions" + ]); + $statuts = DocumentTag::create([ + "name" => "Statuts de la SA LDC", + "slug" => "statuts-de-la-sa-ldc" + ]); + + // Set EN values. + app()->setLocale("en"); + $communique->update([ + "name" => "Press releases and financial notices", + "slug" => "communiques-et-avis-financiers-en" + ]); + $semestriel->update([ + "name" => "Annual and half-yearly financial reports", + "slug" => "rapports-financiers-annuels-et-semestriels-en" + ]); + $droitdevote->update([ + "name" => "Monthly declaration of the number of shares and voting rights", + "slug" => "declaration-mensuelles-du-nombre-dactions-et-de-droits-de-vote-en" + ]); + $rachat->update([ + "name" => "Description of share buyback program", + "slug" => "descriptif-de-programme-de-rachats-dactions-en" + ]); + $liquidite->update([ + "name" => "Liquidity contract transactions", + "slug" => "operations-sur-contrat-de-liquidite-en" + ]); + $trimestriel->update([ + "name" => "Quarterly Information", + "slug" => "information-trimestrielle-en" + ]); + $publication->update([ + "name" => "Publication", + "slug" => "publication-en" + ]); + $finance->update([ + "name" => "Finance", + "slug" => "finance-en" + ]); + $general->update([ + "name" => "General Meeting of Shareholders", + "slug" => "assemblee-generale-des-actionnaires-en" + ]); + $declaration->update([ + "name" => "Declaration of share buybacks", + "slug" => "declaration-des-rachats-dactions-en" + ]); + $statuts->update([ + "name" => "Statutes of SA LDC", + "slug" => "statuts-de-la-sa-ldc-en" + ]); + + // Set locale to the fallback. + app()->setLocale(config('app.fallback_locale')); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 49a4ba61..12807789 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -21,8 +21,14 @@ class DatabaseSeeder extends Seeder PageConfigSeeder::class, DynamicPageSeeder::class, NewsCategorySeeder::class, + NewsTagSeeder::class, NewsSeeder::class, + CompanyActivitySeeder::class, + CompanySectorSeeder::class, CompanySeeder::class, + DocumentCategorySeeder::class, + DocumentTagSeeder::class, + DocumentSeeder::class, ]); } } diff --git a/database/seeders/DocumentCategorySeeder.php b/database/seeders/DocumentCategorySeeder.php index 9c314502..be67b5db 100644 --- a/database/seeders/DocumentCategorySeeder.php +++ b/database/seeders/DocumentCategorySeeder.php @@ -9,43 +9,11 @@ class DocumentCategorySeeder extends Seeder { /** * Run the database seeds. + * + * @return void */ public function run(): void { - app()->setLocale("fr"); - $docs = DocumentCategory::create([ - "name" => "Documents", // pour finance - "slug" => "documents" - ]); - $meetings = DocumentCategory::create([ - "name" => "Assemblées générales", // pour finance - "slug" => "assemblees-generales" - ]); - $investors = DocumentCategory::create([ - "name" => "Présentation investisseurs", // pour finance - "slug" => "presentation-investisseurs" - ]); - $press = DocumentCategory::create([ - "name" => "Espace presse", - "slug" => "espace-presse" - ]); - - app()->setLocale("en"); - $docs->update([ - "name" => "Documents", - "slug" => "documents" - ]); - $meetings->update([ - "name" => "General meetings", - "slug" => "general-meetings" - ]); - $investors->update([ - "name" => "Investor presentation", - "slug" => "investor-presentation" - ]); - $press->update([ - "name" => "Meetings Press area", - "slug" => "meeting-press-area" - ]); + DocumentCategory::factory(10)->create(); } } diff --git a/database/seeders/DocumentSeeder.php b/database/seeders/DocumentSeeder.php index e6746d4a..5ba8691c 100644 --- a/database/seeders/DocumentSeeder.php +++ b/database/seeders/DocumentSeeder.php @@ -3,6 +3,8 @@ namespace Database\Seeders; use App\Models\Document; +use App\Models\DocumentCategory; +use App\Models\DocumentTag; use Illuminate\Database\Seeder; use Uwil\LaravelCommon\Helpers\FileHelper; @@ -10,11 +12,12 @@ class DocumentSeeder extends Seeder { /** * Run the database seeds. + * + * @return void */ public function run(): void { - Document::factory(3)->withTags(3)->withCategories(2)->make() - ->each(function ($model) { + Document::factory(3)->make()->each(function (Document $model) { $model->path = FileHelper::storeFile( $model, new \SplFileInfo(\resource_path( @@ -22,6 +25,22 @@ class DocumentSeeder extends Seeder )) ); $model->saveOrFail(); - });; + }); + + // Document categories relation. + $categoriesIds = DocumentCategory::pluck('id'); + Document::query()->get()->map(function (Document $document) use ($categoriesIds) { + $document->categories()->attach( + $categoriesIds->random(rand(1, 3))->all() + ); + }); + + // Document tags relation. + $tagsIds = DocumentTag::pluck('id'); + Document::query()->get()->map(function (Document $document) use ($tagsIds) { + $document->tags()->attach( + $tagsIds->random(rand(1, 3))->all() + ); + }); } } diff --git a/database/seeders/DocumentTagSeeder.php b/database/seeders/DocumentTagSeeder.php index 21354266..25b74f5f 100644 --- a/database/seeders/DocumentTagSeeder.php +++ b/database/seeders/DocumentTagSeeder.php @@ -9,98 +9,11 @@ class DocumentTagSeeder extends Seeder { /** * Run the database seeds. + * + * @return void */ public function run(): void { - app()->setLocale("fr"); - $communique = DocumentTag::create([ - "name" => "Communiqués et Avis financiers", - "slug" => "communiques-et-avis-financiers" - ]); - $semestriel = DocumentTag::create([ - "name" => "Rapports financiers annuels et semestriels", - "slug" => "rapports-financiers-annuels-et-semestriels" - ]); - $droitdevote = DocumentTag::create([ - "name" => "Déclaration mensuelles du nombre d’actions et de droits de vote", - "slug" => "declaration-mensuelles-du-nombre-dactions-et-de-droits-de-vote" - ]); - $rachat = DocumentTag::create([ - "name" => "Descriptif de programme de rachats d’actions", - "slug" => "descriptif-de-programme-de-rachats-dactions" - ]); - $liquidite = DocumentTag::create([ - "name" => "Opérations sur contrat de liquidité", - "slug" => "operations-sur-contrat-de-liquidite" - ]); - $trimestriel = DocumentTag::create([ - "name" => "Information Trimestrielle", - "slug" => "information-trimestrielle" - ]); - $publication = DocumentTag::create([ - "name" => "Publication", - "slug" => "publication" - ]); - $finance = DocumentTag::create([ - "name" => "Finance", - "slug" => "finance" - ]); - $general = DocumentTag::create([ - "name" => "Assemblée générale des actionnaires", - "slug" => "assemblee-generale-des-actionnaires" - ]); - $declaration = DocumentTag::create([ - "name" => "Déclaration des rachats d’actions", - "slug" => "declaration-des-rachats-dactions" - ]); - $statuts = DocumentTag::create([ - "name" => "Statuts de la SA LDC", - "slug" => "statuts-de-la-sa-ldc" - ]); - app()->setLocale("en"); - $communique->update([ - "name" => "Press releases and financial notices", - "slug" => "communiques-et-avis-financiers-en" - ]); - $semestriel->update([ - "name" => "Annual and half-yearly financial reports", - "slug" => "rapports-financiers-annuels-et-semestriels-en" - ]); - $droitdevote->update([ - "name" => "Monthly declaration of the number of shares and voting rights", - "slug" => "declaration-mensuelles-du-nombre-dactions-et-de-droits-de-vote-en" - ]); - $rachat->update([ - "name" => "Description of share buyback program", - "slug" => "descriptif-de-programme-de-rachats-dactions-en" - ]); - $liquidite->update([ - "name" => "Liquidity contract transactions", - "slug" => "operations-sur-contrat-de-liquidite-en" - ]); - $trimestriel->update([ - "name" => "Quarterly Information", - "slug" => "information-trimestrielle-en" - ]); - $publication->update([ - "name" => "Publication", - "slug" => "publication-en" - ]); - $finance->update([ - "name" => "Finance", - "slug" => "finance-en" - ]); - $general->update([ - "name" => "General Meeting of Shareholders", - "slug" => "assemblee-generale-des-actionnaires-en" - ]); - $declaration->update([ - "name" => "Declaration of share buybacks", - "slug" => "declaration-des-rachats-dactions-en" - ]); - $statuts->update([ - "name" => "Statutes of SA LDC", - "slug" => "statuts-de-la-sa-ldc-en" - ]); + DocumentTag::factory(10)->create(); } } diff --git a/database/seeders/NewsTagSeeder.php b/database/seeders/NewsTagSeeder.php index 3e979239..1350443f 100644 --- a/database/seeders/NewsTagSeeder.php +++ b/database/seeders/NewsTagSeeder.php @@ -9,6 +9,8 @@ class NewsTagSeeder extends Seeder { /** * Run the database seeds. + * + * @return void */ public function run(): void {