From b94f84712abefc574246a247969a391f383fe678 Mon Sep 17 00:00:00 2001 From: Nisha Sharma Date: Thu, 12 Feb 2026 10:27:56 +0100 Subject: [PATCH 1/3] fix: update LicenseFcatory to include License class --- database/factories/LicenseFactory.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/database/factories/LicenseFactory.php b/database/factories/LicenseFactory.php index abfd28b9..54575ae4 100644 --- a/database/factories/LicenseFactory.php +++ b/database/factories/LicenseFactory.php @@ -2,6 +2,7 @@ namespace Database\Factories; +use App\Models\License; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -10,6 +11,13 @@ */ class LicenseFactory extends Factory { + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = License::class; + /** * Define the model's default state. */ From 6e3a04cd91f6bd37c4706ef20ba82f76e793ba1c Mon Sep 17 00:00:00 2001 From: Nisha Sharma Date: Thu, 12 Feb 2026 11:12:05 +0100 Subject: [PATCH 2/3] fix: Update LicenseFactory and add check for existing table in migration --- database/factories/LicenseFactory.php | 8 ++++---- .../2026_02_09_091118_create_author_study_table.php | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/database/factories/LicenseFactory.php b/database/factories/LicenseFactory.php index 54575ae4..6b0545ac 100644 --- a/database/factories/LicenseFactory.php +++ b/database/factories/LicenseFactory.php @@ -23,16 +23,16 @@ class LicenseFactory extends Factory */ public function definition(): array { - $title = $this->faker->sentence($nbWords = 4); + $title = fake()->sentence(4); $slug = Str::slug($title, '-'); return [ 'title' => $title, 'slug' => $slug, 'spdx_id' => Str::random(), - 'url' => $this->faker->url(), - 'description' => $this->faker->text(), - 'body' => $this->faker->text(), + 'url' => fake()->url(), + 'description' => fake()->text(), + 'body' => fake()->text(), 'category' => Str::random(40), ]; } diff --git a/database/migrations/2026_02_09_091118_create_author_study_table.php b/database/migrations/2026_02_09_091118_create_author_study_table.php index 6d2746dd..84efddf6 100644 --- a/database/migrations/2026_02_09_091118_create_author_study_table.php +++ b/database/migrations/2026_02_09_091118_create_author_study_table.php @@ -11,6 +11,10 @@ */ public function up(): void { + if (Schema::hasTable('author_study')) { + return; + } + Schema::create('author_study', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('author_id'); From c385014487a3da4552e140d070b03e69ee5c57d6 Mon Sep 17 00:00:00 2001 From: Nisha Sharma Date: Thu, 12 Feb 2026 13:17:37 +0100 Subject: [PATCH 3/3] fix: update LicenseFactory and remove --nodev flag from Docker file for composer install --- database/factories/LicenseFactory.php | 18 +++++------------- deployment/Dockerfile | 2 +- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/database/factories/LicenseFactory.php b/database/factories/LicenseFactory.php index 6b0545ac..61affb4e 100644 --- a/database/factories/LicenseFactory.php +++ b/database/factories/LicenseFactory.php @@ -2,7 +2,6 @@ namespace Database\Factories; -use App\Models\License; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -11,29 +10,22 @@ */ class LicenseFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var string - */ - protected $model = License::class; - /** * Define the model's default state. */ public function definition(): array { - $title = fake()->sentence(4); + $title = $this->faker->sentence($nbWords = 4); $slug = Str::slug($title, '-'); return [ 'title' => $title, 'slug' => $slug, 'spdx_id' => Str::random(), - 'url' => fake()->url(), - 'description' => fake()->text(), - 'body' => fake()->text(), + 'url' => $this->faker->url(), + 'description' => $this->faker->text(), + 'body' => $this->faker->text(), 'category' => Str::random(40), ]; } -} +} \ No newline at end of file diff --git a/deployment/Dockerfile b/deployment/Dockerfile index 7092912d..013fb1fa 100644 --- a/deployment/Dockerfile +++ b/deployment/Dockerfile @@ -44,7 +44,7 @@ COPY deployment/php.production.ini /usr/local/etc/php/conf.d/production.ini COPY composer.json composer.lock package*.json ./ # Install PHP dependencies -RUN composer install --no-dev --optimize-autoloader --no-interaction --no-progress --no-scripts +RUN composer install --optimize-autoloader --no-interaction --no-progress --no-scripts # Install Node dependencies RUN npm ci --production=false