Files
hub/app/Console/Commands/CreateSystemMenusCommand.php
kelly 3905f86d6a feat: V1 Release - Complete platform with all premium modules
Major Features:
- CRM Lite: Pipeline, tasks, accounts, calendar, inbox
- AI Copilot: Multi-provider support, brand voice, content rules
- Marketing: Campaigns, templates, channels, broadcasts
- Intelligence: Buyer analytics, market intelligence dashboard
- Orchestrator: Sales & marketing automation with AI
- Compliance: License tracking (minimal shell)
- Conversations: Buyer-seller messaging with email/SMS routing

Infrastructure:
- Suites & Plans system for feature gating
- 60+ new migrations
- Module middleware for access control
- Database seeders for production sync
- Enhanced product management (varieties, inventory modes)

Documentation:
- V1 scope, launch checklist, QA scripts
- Module current state audit
- Feature matrix (standard vs premium)
2025-12-01 09:48:40 -07:00

60 lines
1.5 KiB
PHP

<?php
namespace App\Console\Commands;
use App\Models\Brand;
use App\Models\Menu;
use Illuminate\Console\Command;
class CreateSystemMenusCommand extends Command
{
protected $signature = 'menus:create-system {--brand= : Specific brand ID to create menus for}';
protected $description = 'Create system menus (Available Now, Promotions, Daily Deals, Best Sellers) for all brands';
public function handle(): int
{
$brandId = $this->option('brand');
if ($brandId) {
$brands = Brand::where('id', $brandId)->get();
if ($brands->isEmpty()) {
$this->error("Brand with ID {$brandId} not found.");
return self::FAILURE;
}
} else {
$brands = Brand::all();
}
$this->info('Creating system menus for '.count($brands).' brand(s)...');
$bar = $this->output->createProgressBar(count($brands));
$bar->start();
$created = 0;
$skipped = 0;
foreach ($brands as $brand) {
$menus = Menu::createSystemMenusForBrand($brand);
foreach ($menus as $menu) {
if ($menu->wasRecentlyCreated) {
$created++;
} else {
$skipped++;
}
}
$bar->advance();
}
$bar->finish();
$this->newLine(2);
$this->info("Done! Created {$created} new system menus, {$skipped} already existed.");
return self::SUCCESS;
}
}