Add Campaigns module for grouping short links.
Deploy Ladill Link / deploy (push) Successful in 1m26s

Let accounts organise links by promo or launch, attach or detach links, and view combined click totals from the sidebar.
This commit is contained in:
isaacclad
2026-07-16 20:43:11 +00:00
parent 32a174c826
commit f45fdcd159
13 changed files with 702 additions and 2 deletions
@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('campaigns', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->text('description')->nullable();
$table->string('status', 20)->default('active')->index();
$table->timestamp('starts_at')->nullable();
$table->timestamp('ends_at')->nullable();
$table->timestamps();
$table->index(['user_id', 'status']);
});
Schema::table('short_links', function (Blueprint $table) {
$table->foreignId('campaign_id')->nullable()->after('user_id')->constrained('campaigns')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('short_links', function (Blueprint $table) {
$table->dropConstrainedForeignId('campaign_id');
});
Schema::dropIfExists('campaigns');
}
};