Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions database/factories/SponsorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ public function definition(): array
];
}

/**
* Create a sponsor without a website.
*/
public function withoutWebsite(): static
{
return $this->state(fn (array $attributes) => [
'website' => null,
]);
}

/**
* Create a sponsor with an HTTP logo URL (avoids S3 dependency in tests).
*/
public function withTestLogo(): static
{
return $this->state(fn (array $attributes) => [
'logo' => 'https://example.com/logos/test-logo.png',
]);
}

/**
* Create PHP Architect sponsor with specific data.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('sponsors', function (Blueprint $table) {
$table->string('website')->nullable()->change();
});
Comment on lines +14 to +16
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration uses ->change() to alter an existing column, but doctrine/dbal is not installed (not present in composer.json). On common setups (including SQLite), this can cause migrations to fail at runtime. Consider adding the required dependency or rewriting the migration to avoid change() (e.g., a DB-specific alter statement or table rebuild strategy).

Suggested change
Schema::table('sponsors', function (Blueprint $table) {
$table->string('website')->nullable()->change();
});
$connection = Schema::getConnection();
$driver = $connection->getDriverName();
if ($driver === 'mysql') {
$connection->statement('ALTER TABLE sponsors MODIFY website VARCHAR(255) NULL');
} elseif ($driver === 'pgsql') {
$connection->statement('ALTER TABLE sponsors ALTER COLUMN website DROP NOT NULL');
} elseif ($driver === 'sqlsrv') {
$connection->statement('ALTER TABLE sponsors ALTER COLUMN website NVARCHAR(255) NULL');
}

Copilot uses AI. Check for mistakes.
}
Comment thread
ericvanjohnson marked this conversation as resolved.
};
Loading
Loading