Prompt: when user logs in for the first time, they should see a modal asking to create an organization (only name input for organization). Keep the design similar to homepage/login/register in terms of color scheme. User should not be able to delete ALL organization they have, to have at least one is mendatory

Session:
Total cost:            $5.44 (costs may be inaccurate due to usage of unknown models)
Total duration (API):  50m 49s
Total duration (wall): 1h 10m 53s
Total code changes:    2972 lines added, 29 lines removed

Usage by model:
qwen/qwen3.6-35b-a3b:  287.3k input, 69.6k output, 11.5m cache read, 0 cache write ($5.37)
claude-haiku-4-5:  9.4k input, 13.3k output, 8.3k cache read, 0 cache write ($0.0767)

Runtime: llamacpp
Model: Qwen 3.6 35B A3B Q4 K M
Coding Agent: ClaudeCode
This commit is contained in:
Darius Rapalis
2026-04-29 11:15:16 +03:00
parent 8e65638401
commit b4b2fd8c1e
11 changed files with 2476 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
<?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('organizations', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('organizations');
}
};

View File

@@ -0,0 +1,22 @@
<?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::table('users', function (Blueprint $table) {
$table->boolean('has_organization')->default(false)->after('password');
});
}
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('has_organization');
});
}
};

View File

@@ -0,0 +1,26 @@
<?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('users', function (Blueprint $table) {
$table->foreignId('current_organization_id')->nullable()->constrained('organizations')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropForeign(['current_organization_id']);
$table->dropColumn('current_organization_id');
});
}
};