Files
hub/app/Console/Commands/DevSetup.php
kelly 5b78f8db0f feat: brand profile page rebuild, dev tooling, and CRM refactor
- Rebuild brand profile page with 3-zone architecture:
  Zone 1: Identity bar (logo, name, tagline, score, actions)
  Zone 2: Dashboard snapshot (8 KPI cards, insight banners, tab bar)
  Zone 3: Tabbed content panels (9 sections)

- Add dev:setup command for local environment setup
  - Runs migrations with optional --fresh flag
  - Prompts to seed dev fixtures
  - Displays test credentials on completion

- Add development seeders (not called from DatabaseSeeder):
  - ProductionSyncSeeder: users, businesses, brands
  - DevSuitesSeeder: suite and plan assignments
  - BrandProfilesSeeder: brand AI profiles

- Refactor CRM from Modules/Crm to app/ structure
  - Move entities to app/Models/Crm/
  - Move controllers to app/Http/Controllers/Crm/
  - Remove old modular structure

- Update CLAUDE.md with dev setup documentation
2025-12-01 19:53:54 -07:00

76 lines
2.5 KiB
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class DevSetup extends Command
{
protected $signature = 'dev:setup
{--fresh : Drop all tables and re-run migrations}
{--skip-seed : Skip seeding dev fixtures}';
protected $description = 'Set up local development environment with migrations and dev fixtures';
public function handle(): int
{
if (app()->environment('production')) {
$this->error('This command cannot be run in production!');
return self::FAILURE;
}
$this->info('Setting up development environment...');
$this->newLine();
// Run migrations
if ($this->option('fresh')) {
$this->warn('Dropping all tables and re-running migrations...');
$this->call('migrate:fresh');
} else {
$this->info('Running migrations...');
$this->call('migrate');
}
$this->newLine();
// Seed dev fixtures
if (! $this->option('skip-seed')) {
if ($this->confirm('Seed development fixtures (users, businesses, brands)?', true)) {
$this->info('Seeding development fixtures...');
$this->call('db:seed', ['--class' => 'ProductionSyncSeeder']);
$this->newLine();
$this->info('Seeding dev suites and plans...');
$this->call('db:seed', ['--class' => 'DevSuitesSeeder']);
$this->newLine();
$this->info('Seeding brand profiles...');
$this->call('db:seed', ['--class' => 'BrandProfilesSeeder']);
$this->newLine();
$this->info('Seeding orchestrator profiles...');
$this->call('orchestrator:seed-brand-profiles', ['--force' => true]);
}
}
$this->newLine();
$this->info('Development setup complete!');
$this->newLine();
$this->table(
['Credential', 'Email', 'Password'],
[
['Super Admin', 'admin@cannabrands.com', 'password'],
['Admin', 'admin@example.com', 'password'],
['Seller', 'seller@example.com', 'password'],
['Buyer', 'buyer@example.com', 'password'],
['Cannabrands Owner', 'cannabrands-owner@example.com', 'password'],
['Brand Manager', 'brand-manager@example.com', 'password'],
]
);
return self::SUCCESS;
}
}