output:
Chunk ID: 41f4d8
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 6676
Output:
database/factories/ShippingZoneFactory.php:21:            'store_id' => Store::factory(),
routes/web.php:37:Route::livewire('admin/login', AdminLogin::class)
routes/web.php:39:    ->name('admin.login');
routes/web.php:41:Route::post('admin/logout', function () {
routes/web.php:47:    return redirect()->route('admin.login');
routes/web.php:48:})->middleware('auth')->name('admin.logout');
routes/web.php:50:Route::middleware(['auth', 'verified', 'admin'])->prefix('admin')->name('admin.')->group(function (): void {
routes/web.php:79:Route::redirect('dashboard', 'admin')
database/factories/ProductFactory.php:27:            'store_id' => Store::factory(),
bootstrap/app.php:26:        $middleware->appendToGroup('admin', [
database/factories/NavigationMenuFactory.php:24:            'store_id' => Store::factory(),
database/factories/StoreSettingsFactory.php:21:            'store_id' => Store::factory(),
database/factories/DiscountFactory.php:24:            'store_id' => Store::factory(),
database/factories/TaxSettingsFactory.php:22:            'store_id' => Store::factory(),
database/factories/InventoryItemFactory.php:26:            'store_id' => fn (array $attributes): mixed => ProductVariant::query()
database/factories/InventoryItemFactory.php:30:                ?->store_id ?? Store::factory(),
app/Support/HandleGenerator.php:29:            ->where('store_id', $storeId)
database/factories/PageFactory.php:25:            'store_id' => Store::factory(),
database/factories/CustomerFactory.php:21:            'store_id' => Store::factory(),
database/factories/CartFactory.php:23:            'store_id' => Store::factory(),
database/factories/OrderFactory.php:31:            'store_id' => Store::factory(),
database/factories/CheckoutFactory.php:24:            'store_id' => Store::factory(),
app/Models/Order.php:24:        'store_id',
database/factories/CollectionFactory.php:26:            'store_id' => Store::factory(),
database/factories/ThemeFactory.php:22:            'store_id' => Store::factory(),
app/Models/Concerns/BelongsToStore.php:5:use App\Models\Scopes\StoreScope;
app/Models/Concerns/BelongsToStore.php:12:        static::addGlobalScope(new StoreScope);
app/Models/Concerns/BelongsToStore.php:15:            if ($model->store_id || ! app()->bound('current_store')) {
app/Models/Concerns/BelongsToStore.php:19:            $store = app('current_store');
app/Models/Concerns/BelongsToStore.php:22:                $model->store_id = $store->getKey();
app/Auth/CustomerUserProvider.php:36:        $store = app()->bound('current_store') ? app('current_store') : null;
app/Auth/CustomerUserProvider.php:42:        $query->where('store_id', $store->getKey());
database/factories/StoreDomainFactory.php:22:            'store_id' => Store::factory(),
database/factories/StoreDomainFactory.php:30:    public function admin(): static
app/Models/NavigationItem.php:40:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/NavigationItem.php:41:            if (! app()->bound('current_store')) {
app/Models/NavigationItem.php:45:            $store = app('current_store');
app/Models/NavigationItem.php:54:                    ->where('store_id', $store->getKey());
app/Models/NavigationMenu.php:20:        'store_id',
app/Models/ProductOption.php:36:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/ProductOption.php:37:            if (! app()->bound('current_store')) {
app/Models/ProductOption.php:41:            $store = app('current_store');
app/Models/ProductOption.php:50:                    ->where('store_id', $store->getKey());
app/Services/VariantMatrixService.php:89:                    'store_id' => $product->store_id,
app/Services/VariantMatrixService.php:111:                'store_id' => $product->store_id,
app/Services/VariantMatrixService.php:183:                'store_id' => $product->store_id,
app/Services/VariantMatrixService.php:201:        return Store::query()->findOrFail($product->store_id);
app/Models/Scopes/StoreScope.php:10:class StoreScope implements Scope
app/Models/Scopes/StoreScope.php:14:        if (! app()->bound('current_store')) {
app/Models/Scopes/StoreScope.php:18:        $store = app('current_store');
app/Models/Scopes/StoreScope.php:24:        $builder->where($model->qualifyColumn('store_id'), $store->getKey());
app/Traits/ChecksStoreRole.php:54:        if (! app()->bound('current_store')) {
app/Traits/ChecksStoreRole.php:58:        $store = app('current_store');
app/Traits/ChecksStoreRole.php:66:            $storeId = $model->getAttribute('store_id');
app/Traits/ChecksStoreRole.php:71:        if (property_exists($model, 'store_id')) {
app/Traits/ChecksStoreRole.php:72:            return is_numeric($model->store_id) ? (int) $model->store_id : null;
app/Models/InventoryItem.php:23:        'store_id',
app/Models/InventoryItem.php:48:            if (! $item->store_id) {
app/Models/InventoryItem.php:49:                $item->store_id = $storeId;
app/Models/InventoryItem.php:54:            if ((int) $item->store_id !== $storeId) {
app/Models/InventoryItem.php:72:            ->value('store_id');
app/Models/ThemeFile.php:37:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/ThemeFile.php:38:            if (! app()->bound('current_store')) {
app/Models/ThemeFile.php:42:            $store = app('current_store');
app/Models/ThemeFile.php:51:                    ->where('store_id', $store->getKey());
app/Services/DiscountService.php:25:            ->where('store_id', $store->getKey())
app/Models/StoreUser.php:22:        'store_id',
app/Models/Cart.php:21:        'store_id',
app/Services/PricingEngine.php:125:            ->where('store_id', $checkout->store_id)
app/Services/PricingEngine.php:127:                'store_id' => $checkout->store_id,
app/Models/CartLine.php:43:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/CartLine.php:44:            if (! app()->bound('current_store')) {
app/Models/CartLine.php:48:            $store = app('current_store');
app/Models/CartLine.php:57:                    ->where('store_id', $store->getKey());
database/seeders/DiscountSeeder.php:20:                        'store_id' => $store->getKey(),
app/Models/StoreSettings.php:18:    protected $primaryKey = 'store_id';
app/Models/StoreSettings.php:24:        'store_id',
app/Models/Product.php:22:        'store_id',
app/Models/Discount.php:22:        'store_id',
app/Models/ShippingRate.php:40:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/ShippingRate.php:41:            if (! app()->bound('current_store')) {
app/Models/ShippingRate.php:45:            $store = app('current_store');
app/Models/ShippingRate.php:54:                    ->where('store_id', $store->getKey());
app/Jobs/ProcessMediaUpload.php:66:                    ->where('store_id', $this->storeId);
app/Models/Checkout.php:20:        'store_id',
app/Models/ProductMedia.php:47:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/ProductMedia.php:48:            if (! app()->bound('current_store')) {
app/Models/ProductMedia.php:52:            $store = app('current_store');
app/Models/ProductMedia.php:61:                    ->where('store_id', $store->getKey());
app/Models/Page.php:20:        'store_id',
app/Services/CartService.php:27:            'store_id' => $store->getKey(),
app/Services/CartService.php:41:                ->where('store_id', $store->getKey())
app/Services/CartService.php:49:                    ->where('store_id', $store->getKey())
app/Services/CartService.php:66:                ->where('store_id', $store->getKey())
app/Services/CartService.php:86:                ->where('store_id', $store->getKey())
app/Services/CartService.php:104:            ->where('store_id', $store->getKey())
app/Services/CartService.php:248:        if ((int) $variant->product->store_id !== (int) $cart->store_id) {
app/Models/Theme.php:22:        'store_id',
app/Services/ThemeSettingsService.php:34:            ->where('store_id', $store->getKey())
app/Models/ThemeSettings.php:31:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/ThemeSettings.php:32:            if (! app()->bound('current_store')) {
app/Models/ThemeSettings.php:36:            $store = app('current_store');
app/Models/ThemeSettings.php:45:                    ->where('store_id', $store->getKey());
app/Services/ShippingCalculator.php:46:            ->where('store_id', $store->getKey())
app/Models/StoreDomain.php:21:        'store_id',
app/Livewire/Storefront/Account/Orders/Show.php:22:        $store = app('current_store');
app/Livewire/Storefront/Account/Orders/Show.php:28:            ->where('store_id', $store->getKey())
app/Livewire/Storefront/Account/Orders/Show.php:52:            ->where('store_id', $this->storeId)
app/Livewire/Admin/Collections/Form.php:36:            $store = app('current_store');
app/Livewire/Admin/Collections/Form.php:38:            abort_unless($store instanceof Store && (int) $collection->store_id === $store->getKey(), 404);
app/Livewire/Admin/Collections/Form.php:71:        $store = app('current_store');
app/Livewire/Admin/Collections/Form.php:81:                    ->where('store_id', $store->getKey())
app/Livewire/Admin/Collections/Form.php:89:            'store_id' => $store->getKey(),
app/Livewire/Admin/Collections/Form.php:145:        return view('livewire.admin.collections.form', [
app/Services/ProductService.php:43:                'store_id' => $store->getKey(),
app/Services/ProductService.php:87:            $storeId = $product->store_id;
app/Services/ProductService.php:181:                'store_id' => $store->getKey(),
app/Services/ProductService.php:289:            ->whereHas('product', fn ($query) => $query->where('store_id', $store->getKey()));
app/Services/CheckoutService.php:41:            'store_id' => $cart->store_id,
database/seeders/PageSeeder.php:20:                        'store_id' => $store->getKey(),
app/Models/ProductVariant.php:51:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/ProductVariant.php:52:            if (! app()->bound('current_store')) {
app/Models/ProductVariant.php:56:            $store = app('current_store');
app/Models/ProductVariant.php:65:                    ->where('store_id', $store->getKey());
app/Models/ProductVariant.php:80:                ->value('store_id');
app/Models/ProductVariant.php:87:                'store_id' => $storeId,
app/Models/ProductVariant.php:106:            ->value('store_id');
app/Models/ProductVariant.php:117:                    ->where('store_id', $storeId);
app/Models/Customer.php:21:        'store_id',
app/Livewire/Admin/Collections/Index.php:50:        return view('livewire.admin.collections.index', [
app/Livewire/Storefront/Account/Orders/Index.php:20:        $store = app('current_store');
app/Livewire/Storefront/Account/Orders/Index.php:46:            ->where('store_id', $this->storeId)
app/Services/NavigationService.php:23:            ->where('store_id', $store->getKey())
app/Services/NavigationService.php:72:            ->where('store_id', $this->storeIdFor($item))
app/Services/NavigationService.php:81:            ->where('store_id', $this->storeIdFor($item))
app/Services/NavigationService.php:90:            ->where('store_id', $this->storeIdFor($item))
app/Services/NavigationService.php:99:            return (int) $item->menu->store_id;
app/Services/NavigationService.php:104:            ->value('store_id');
app/Services/NavigationService.php:114:        return "navigation:{$menu->store_id}:{$menu->handle}";
app/Models/ProductOptionValue.php:36:        static::addGlobalScope('current_store', function (Builder $builder): void {
app/Models/ProductOptionValue.php:37:            if (! app()->bound('current_store')) {
app/Models/ProductOptionValue.php:41:            $store = app('current_store');
app/Models/ProductOptionValue.php:50:                    ->where('store_id', $store->getKey());
app/Models/Collection.php:22:        'store_id',
app/Livewire/Admin/Orders/Show.php:11:        return view('livewire.admin.orders.show');
app/Models/ShippingZone.php:22:        'store_id',
app/Services/OrderService.php:79:                    'store_id' => $checkout->store_id,
app/Services/OrderService.php:229:            ->where('store_id', $store->getKey())
app/Services/OrderService.php:235:            ->where('store_id', $store->getKey())
app/Services/OrderService.php:352:            ->where('store_id', $checkout->store_id)
app/Enums/StoreDomainType.php:8:    case Admin = 'admin';
app/Livewire/Storefront/Account/Auth/Register.php:27:        $store = app('current_store');
app/Livewire/Storefront/Account/Auth/Register.php:38:        app()->instance('current_store', $store);
app/Livewire/Storefront/Account/Auth/Register.php:46:                Rule::unique('customers', 'email')->where('store_id', $store->getKey()),
app/Livewire/Storefront/Account/Auth/Register.php:53:            'store_id' => $store->getKey(),
app/Livewire/Admin/Orders/Index.php:11:        return view('livewire.admin.orders.index');
app/Models/TaxSettings.php:20:    protected $primaryKey = 'store_id';
app/Models/TaxSettings.php:26:        'store_id',
app/Livewire/Storefront/Checkout/Confirmation.php:22:        $store = app('current_store');
app/Livewire/Storefront/Checkout/Confirmation.php:27:            ->where('store_id', $store->getKey())
app/Livewire/Storefront/Checkout/Confirmation.php:62:            ->where('store_id', $this->storeId)
app/Livewire/Storefront/Account/Auth/Login.php:25:        $store = app('current_store');
app/Livewire/Storefront/Account/Auth/Login.php:50:        app()->instance('current_store', Store::query()->findOrFail($this->storeId));
database/seeders/CollectionSeeder.php:35:                        'store_id' => $store->getKey(),
app/Livewire/Storefront/Home.php:16:        $store = app('current_store');
app/Livewire/Admin/Inventory/Index.php:50:        return view('livewire.admin.inventory.index', [
app/Livewire/Storefront/Checkout/Show.php:257:            app()->instance('current_store', $store);
app/Livewire/Storefront/Checkout/Show.php:262:        $store = app('current_store');
app/Livewire/Storefront/Products/Show.php:92:            app()->instance('current_store', $store);
app/Livewire/Storefront/Products/Show.php:97:        $store = app('current_store');
database/seeders/StoreUserSeeder.php:17:        $user = User::query()->where('email', 'admin@acme.test')->firstOrFail();
database/seeders/StoreUserSeeder.php:22:                    'store_id' => $store->getKey(),
app/Http/Controllers/Api/Storefront/V1/CartController.php:31:        $store = app('current_store');
app/Livewire/Storefront/Cart/Show.php:144:            app()->instance('current_store', $store);
app/Livewire/Storefront/Cart/Show.php:149:        $store = app('current_store');
app/Livewire/Storefront/CartDrawer.php:76:            app()->instance('current_store', $store);
app/Livewire/Storefront/CartDrawer.php:81:        $store = app('current_store');
app/Livewire/Admin/Auth/Login.php:26:        $key = 'admin-login:'.request()->ip();
app/Livewire/Admin/Auth/Login.php:56:        $this->redirectRoute('admin.dashboard', navigate: true);
app/Livewire/Admin/Auth/Login.php:61:        return view('livewire.admin.auth.login')
app/Livewire/Admin/Products/Form.php:58:            $store = app('current_store');
app/Livewire/Admin/Products/Form.php:60:            abort_unless($store instanceof Store && (int) $product->store_id === $store->getKey(), 404);
app/Livewire/Admin/Products/Form.php:102:        $store = app('current_store');
app/Livewire/Admin/Products/Form.php:117:                    ->where('store_id', $store->getKey())
app/Livewire/Admin/Products/Form.php:173:        $this->redirectRoute('admin.products.index', navigate: true);
app/Livewire/Admin/Products/Form.php:178:        return view('livewire.admin.products.form', [
app/Livewire/Admin/Products/Form.php:305:                    'store_id' => $store->getKey(),
app/Livewire/Admin/Products/Form.php:362:                    ->where('store_id', $store->getKey());
database/seeders/ThemeSeeder.php:19:                    'store_id' => $store->getKey(),
app/Livewire/Admin/Products/Index.php:123:        return view('livewire.admin.products.index', [
database/seeders/TaxSettingsSeeder.php:18:                ['store_id' => $store->getKey()],
database/seeders/UserSeeder.php:16:            ['email' => 'admin@acme.test'],
database/seeders/StoreDomainSeeder.php:28:                        'store_id' => $store->getKey(),
database/seeders/ShippingZoneSeeder.php:19:                    'store_id' => $store->getKey(),
app/Http/Resources/Storefront/V1/CartResource.php:21:            'store_id' => $this->store_id,
database/seeders/NavigationMenuSeeder.php:23:                        'store_id' => $store->getKey(),
database/seeders/ProductSeeder.php:35:            ->where('store_id', $store->getKey())
database/seeders/ProductSeeder.php:42:                    'store_id' => $store->getKey(),
database/seeders/ProductSeeder.php:47:                    'store_id' => $store->getKey(),
database/seeders/ProductSeeder.php:141:                    'store_id' => $store->getKey(),
app/Http/Resources/Storefront/V1/CheckoutResource.php:19:            'store_id' => $this->store_id,
database/seeders/StoreSettingsSeeder.php:18:                ['store_id' => $store->getKey()],
app/Http/Middleware/ResolveStore.php:22:        $store = $request->is('admin*')
app/Http/Middleware/ResolveStore.php:28:        app()->instance('current_store', $store);
app/Http/Middleware/ResolveStore.php:30:        if (! $request->is('admin*') && $store->status === StoreStatus::Suspended) {
app/Http/Middleware/ResolveStore.php:34:        if ($request->is('admin*') && $store->status === StoreStatus::Suspended && ! $request->isMethodSafe()) {
app/Http/Middleware/ResolveStore.php:49:                ->value('store_id');
app/Http/Middleware/ResolveStore.php:63:        $storeId = $request->session()->get('current_store_id');
app/Http/Middleware/ResolveStore.php:69:                $request->session()->put('current_store_id', $storeId);
database/seeders/CustomerSeeder.php:20:                'store_id' => $store->getKey(),
app/Http/Middleware/CheckStoreRole.php:20:        $store = app()->bound('current_store') ? app('current_store') : null;
database/migrations/2026_05_03_213902_create_collections_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_213902_create_collections_table.php:24:            $table->unique(['store_id', 'handle']);
database/migrations/2026_05_03_213902_create_collections_table.php:25:            $table->index('store_id');
database/migrations/2026_05_03_213902_create_collections_table.php:26:            $table->index(['store_id', 'status']);
database/seeders/NavigationItemSeeder.php:21:                ->where('store_id', $store->getKey())
database/seeders/NavigationItemSeeder.php:93:            ->where('store_id', $store->getKey())
database/seeders/NavigationItemSeeder.php:101:            ->where('store_id', $store->getKey())
database/migrations/2026_05_03_212158_create_customer_password_reset_tokens_table.php:15:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_212158_create_customer_password_reset_tokens_table.php:20:            $table->primary(['store_id', 'email']);
database/migrations/2026_05_04_000408_create_orders_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_04_000408_create_orders_table.php:36:            $table->unique(['store_id', 'order_number']);
database/migrations/2026_05_04_000408_create_orders_table.php:38:            $table->index('store_id');
database/migrations/2026_05_04_000408_create_orders_table.php:40:            $table->index(['store_id', 'status']);
database/migrations/2026_05_04_000408_create_orders_table.php:41:            $table->index(['store_id', 'financial_status']);
database/migrations/2026_05_04_000408_create_orders_table.php:42:            $table->index(['store_id', 'fulfillment_status']);
database/migrations/2026_05_04_000408_create_orders_table.php:43:            $table->index(['store_id', 'placed_at']);
app/Http/Requests/Api/Storefront/V1/StoreCartRequest.php:27:        $store = app()->bound('current_store') ? app('current_store') : null;
database/migrations/2026_05_03_225409_create_checkouts_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_225409_create_checkouts_table.php:31:            $table->index('store_id');
database/migrations/2026_05_03_225409_create_checkouts_table.php:34:            $table->index(['store_id', 'status']);
database/migrations/2026_05_03_225400_create_carts_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_225400_create_carts_table.php:23:            $table->index('store_id');
database/migrations/2026_05_03_225400_create_carts_table.php:25:            $table->index(['store_id', 'status']);
app/Enums/StoreUserRole.php:8:    case Admin = 'admin';
database/migrations/2026_05_03_223841_create_pages_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_223841_create_pages_table.php:24:            $table->unique(['store_id', 'handle']);
database/migrations/2026_05_03_223841_create_pages_table.php:25:            $table->index('store_id');
database/migrations/2026_05_03_223841_create_pages_table.php:26:            $table->index(['store_id', 'status']);
database/migrations/2026_05_03_223824_create_themes_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_223824_create_themes_table.php:23:            $table->index('store_id');
database/migrations/2026_05_03_223824_create_themes_table.php:24:            $table->index(['store_id', 'status']);
database/migrations/2026_05_03_211425_create_store_users_table.php:15:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_211425_create_store_users_table.php:17:            $table->enum('role', ['owner', 'admin', 'staff', 'support'])->default('staff');
database/migrations/2026_05_03_211425_create_store_users_table.php:20:            $table->primary(['store_id', 'user_id']);
database/migrations/2026_05_03_211425_create_store_users_table.php:22:            $table->index(['store_id', 'role']);
database/migrations/2026_05_03_211416_create_store_domains_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_211416_create_store_domains_table.php:18:            $table->enum('type', ['storefront', 'admin', 'api'])->default('storefront');
database/migrations/2026_05_03_211416_create_store_domains_table.php:23:            $table->index('store_id');
database/migrations/2026_05_03_211416_create_store_domains_table.php:24:            $table->index(['store_id', 'is_primary']);
database/migrations/2026_05_03_225413_create_shipping_zones_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_225413_create_shipping_zones_table.php:21:            $table->index('store_id');
database/migrations/2026_05_03_225422_create_tax_settings_table.php:15:            $table->foreignId('store_id')->primary()->constrained()->cascadeOnDelete();
app/Providers/AppServiceProvider.php:82:            if ($request->is('admin*')) {
app/Providers/AppServiceProvider.php:83:                return route('admin.login');
app/Providers/AppServiceProvider.php:97:            $store = app()->bound('current_store') ? app('current_store') : null;
database/migrations/2026_05_03_225427_create_discounts_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_225427_create_discounts_table.php:29:            $table->unique(['store_id', 'code']);
database/migrations/2026_05_03_225427_create_discounts_table.php:30:            $table->index('store_id');
database/migrations/2026_05_03_225427_create_discounts_table.php:31:            $table->index(['store_id', 'status']);
database/migrations/2026_05_03_225427_create_discounts_table.php:32:            $table->index(['store_id', 'type']);
database/migrations/2026_05_03_211556_create_customers_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_211556_create_customers_table.php:23:            $table->unique(['store_id', 'email']);
database/migrations/2026_05_03_211556_create_customers_table.php:24:            $table->index('store_id');
database/migrations/2026_05_03_223844_create_navigation_menus_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_223844_create_navigation_menus_table.php:21:            $table->unique(['store_id', 'handle']);
database/migrations/2026_05_03_223844_create_navigation_menus_table.php:22:            $table->index('store_id');
database/migrations/2026_05_03_213856_create_products_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_213856_create_products_table.php:27:            $table->unique(['store_id', 'handle']);
database/migrations/2026_05_03_213856_create_products_table.php:28:            $table->index('store_id');
database/migrations/2026_05_03_213856_create_products_table.php:29:            $table->index(['store_id', 'status']);
database/migrations/2026_05_03_213856_create_products_table.php:30:            $table->index(['store_id', 'published_at']);
database/migrations/2026_05_03_213856_create_products_table.php:31:            $table->index(['store_id', 'vendor']);
database/migrations/2026_05_03_213856_create_products_table.php:32:            $table->index(['store_id', 'product_type']);
database/migrations/2026_05_03_211419_create_store_settings_table.php:15:            $table->foreignId('store_id')->primary()->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_213901_create_inventory_items_table.php:16:            $table->foreignId('store_id')->constrained()->cascadeOnDelete();
database/migrations/2026_05_03_213901_create_inventory_items_table.php:22:            $table->index('store_id');


output:
Chunk ID: f383ef
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 538
Output:
<?php

namespace App\Http\Middleware;

use App\Enums\StoreStatus;
use App\Models\Store;
use App\Models\StoreDomain;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Symfony\Component\HttpFoundation\Response;

class ResolveStore
{
    /**
     * Handle an incoming request.
     *
     * @param  \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response)  $next
     */
    public function handle(Request $request, Closure $next): Response
    {
        $store = $request->is('admin*')
            ? $this->resolveAdminStore($request)
            : $this->resolveStorefrontStore($request);

        abort_unless($store, 404);

        app()->instance('current_store', $store);

        if (! $request->is('admin*') && $store->status === StoreStatus::Suspended) {
            abort(503);
        }

        if ($request->is('admin*') && $store->status === StoreStatus::Suspended && ! $request->isMethodSafe()) {
            abort(403);
        }

        return $next($request);
    }

    private function resolveStorefrontStore(Request $request): ?Store
    {
        $hostname = $request->getHost();
        $cacheKey = "store_domain:{$hostname}";

        $storeId = Cache::remember($cacheKey, now()->addMinutes(5), function () use ($hostname): ?int {
            return StoreDomain::query()
                ->where('hostname', $hostname)
                ->value('store_id');
        });

        return $storeId ? Store::query()->find($storeId) : null;
    }

    private function resolveAdminStore(Request $request): ?Store
    {
        $user = $request->user();

        if (! $user) {
            return null;
        }

        $storeId = $request->session()->get('current_store_id');

        if (! $storeId) {
            $storeId = $user->stores()->oldest('stores.id')->value('stores.id');

            if ($storeId) {
                $request->session()->put('current_store_id', $storeId);
            }
        }

        if (! $storeId || ! $user->stores()->whereKey($storeId)->exists()) {
            return null;
        }

        return Store::query()->find($storeId);
    }
}


output:
Chunk ID: ab9f40
Wall time: 0.0000 seconds
Process exited with code 1
Original token count: 18
Output:
sed: app/Http/Middleware/EnsureAdminUser.php: No such file or directory


output:
Chunk ID: e21b20
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 284
Output:
<?php

namespace App\Models\Concerns;

use App\Models\Scopes\StoreScope;
use App\Models\Store;

trait BelongsToStore
{
    public static function bootBelongsToStore(): void
    {
        static::addGlobalScope(new StoreScope);

        static::creating(function (object $model): void {
            if ($model->store_id || ! app()->bound('current_store')) {
                return;
            }

            $store = app('current_store');

            if ($store instanceof Store) {
                $model->store_id = $store->getKey();
            }
        });
    }
}
<?php

namespace App\Models\Scopes;

use App\Models\Store;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;

class StoreScope implements Scope
{
    public function apply(Builder $builder, Model $model): void
    {
        if (! app()->bound('current_store')) {
            return;
        }

        $store = app('current_store');

        if (! $store instanceof Store) {
            return;
        }

        $builder->where($model->qualifyColumn('store_id'), $store->getKey());
    }
}


cmd: sed -n '1,100p' bootstrap/app.php && rg -n "class CheckStoreRole" app/Http/Middleware app -g '*.php'


command: sed -n '1,100p' bootstrap/app.php && rg -n "class CheckStoreRole" app/Http/Middleware app -g '*.php'

app.php

type: read

cmd: sed -n '1,100p' bootstrap/app.php

type: search

cmd: rg -n 'class CheckStoreRole' app/Http/Middleware app -g '*.php'

query: class CheckStoreRole

path: Middleware

aggregated_output:
<?php

use App\Http\Middleware\CheckStoreRole;
use App\Http\Middleware\ResolveStore;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        api: __DIR__.'/../routes/api.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware): void {
        $middleware->alias([
            'role.check' => CheckStoreRole::class,
            'store.resolve' => ResolveStore::class,
        ]);

        $middleware->appendToGroup('storefront', [
            ResolveStore::class,
        ]);

        $middleware->appendToGroup('admin', [
            ResolveStore::class,
            CheckStoreRole::class,
        ]);
    })
    ->withExceptions(function (Exceptions $exceptions): void {
        //
    })->create();
app/Http/Middleware/CheckStoreRole.php:11:class CheckStoreRole
app/Http/Middleware/CheckStoreRole.php:11:class CheckStoreRole

status: completed


output:
Chunk ID: a82dc2
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 283
Output:
<?php

use App\Http\Middleware\CheckStoreRole;
use App\Http\Middleware\ResolveStore;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        api: __DIR__.'/../routes/api.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware): void {
        $middleware->alias([
            'role.check' => CheckStoreRole::class,
            'store.resolve' => ResolveStore::class,
        ]);

        $middleware->appendToGroup('storefront', [
            ResolveStore::class,
        ]);

        $middleware->appendToGroup('admin', [
            ResolveStore::class,
            CheckStoreRole::class,
        ]);
    })
    ->withExceptions(function (Exceptions $exceptions): void {
        //
    })->create();
app/Http/Middleware/CheckStoreRole.php:11:class CheckStoreRole
app/Http/Middleware/CheckStoreRole.php:11:class CheckStoreRole


cmd: sed -n '1,220p' app/Http/Middleware/CheckStoreRole.php


command: sed -n '1,220p' app/Http/Middleware/CheckStoreRole.php

aggregated_output:
<?php

namespace App\Http\Middleware;

use App\Enums\StoreUserRole;
use App\Models\Store;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class CheckStoreRole
{
    /**
     * Handle an incoming request.
     *
     * @param  \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response)  $next
     */
    public function handle(Request $request, Closure $next, string ...$roles): Response
    {
        $store = app()->bound('current_store') ? app('current_store') : null;
        $user = $request->user();

        abort_unless($store instanceof Store && $user, 403);

        $role = $user->roleForStore($store);

        if ($roles === []) {
            abort_unless($role !== null, 403);

            return $next($request);
        }

        $allowedRoles = array_filter(array_map(
            fn (string $role): ?StoreUserRole => StoreUserRole::tryFrom($role),
            $roles,
        ));

        abort_unless($role !== null && in_array($role, $allowedRoles, true), 403);

        return $next($request);
    }
}


output:
Chunk ID: bfcc4c
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 272
Output:
<?php

namespace App\Http\Middleware;

use App\Enums\StoreUserRole;
use App\Models\Store;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class CheckStoreRole
{
    /**
     * Handle an incoming request.
     *
     * @param  \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response)  $next
     */
    public function handle(Request $request, Closure $next, string ...$roles): Response
    {
        $store = app()->bound('current_store') ? app('current_store') : null;
        $user = $request->user();

        abort_unless($store instanceof Store && $user, 403);

        $role = $user->roleForStore($store);

        if ($roles === []) {
            abort_unless($role !== null, 403);

            return $next($request);
        }

        $allowedRoles = array_filter(array_map(
            fn (string $role): ?StoreUserRole => StoreUserRole::tryFrom($role),
            $roles,
        ));

        abort_unless($role !== null && in_array($role, $allowedRoles, true), 403);

        return $next($request);
    }
}


cmd: sed -n '1,220p' app/Models/Customer.php && sed -n '1,180p' database/factories/CustomerFactory.php


command: sed -n '1,220p' app/Models/Customer.php && sed -n '1,180p' database/factories/CustomerFactory.php

Customer.php

cmd: sed -n '1,220p' app/Models/Customer.php

CustomerFactory.php

aggregated_output:
<?php

namespace App\Models;

use App\Models\Concerns\BelongsToStore;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Hash;

class Customer extends Authenticatable
{
    /** @use HasFactory<\Database\Factories\CustomerFactory> */
    use BelongsToStore, HasFactory, Notifiable;

    /**
     * @var list<string>
     */
    protected $fillable = [
        'store_id',
        'email',
        'password',
        'name',
        'marketing_opt_in',
    ];

    /**
     * @var list<string>
     */
    protected $hidden = [
        'password_hash',
        'remember_token',
    ];

    public function getAuthPassword(): ?string
    {
        return $this->password_hash;
    }

    public function setPasswordAttribute(?string $value): void
    {
        $this->attributes['password_hash'] = $value && Hash::needsRehash($value) ? Hash::make($value) : $value;
    }

    public function getPasswordAttribute(): ?string
    {
        return $this->password_hash;
    }

    /**
     * @return HasMany<Cart, $this>
     */
    public function carts(): HasMany
    {
        return $this->hasMany(Cart::class);
    }

    /**
     * @return HasMany<Checkout, $this>
     */
    public function checkouts(): HasMany
    {
        return $this->hasMany(Checkout::class);
    }

    /**
     * @return HasMany<CustomerAddress, $this>
     */
    public function addresses(): HasMany
    {
        return $this->hasMany(CustomerAddress::class);
    }

    /**
     * @return HasMany<Order, $this>
     */
    public function orders(): HasMany
    {
        return $this->hasMany(Order::class);
    }

    /**
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'marketing_opt_in' => 'bool',
        ];
    }
}
<?php

namespace Database\Factories;

use App\Models\Store;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Customer>
 */
class CustomerFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'store_id' => Store::factory(),
            'email' => fake()->unique()->safeEmail(),
            'password' => 'password',
            'name' => fake()->name(),
            'marketing_opt_in' => false,
        ];
    }

    public function guest(): static
    {
        return $this->state(fn (array $attributes): array => [
            'password' => null,
        ]);
    }
}


output:
Chunk ID: 5fdc3d
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 689
Output:
<?php

namespace App\Models;

use App\Models\Concerns\BelongsToStore;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Hash;

class Customer extends Authenticatable
{
    /** @use HasFactory<\Database\Factories\CustomerFactory> */
    use BelongsToStore, HasFactory, Notifiable;

    /**
     * @var list<string>
     */
    protected $fillable = [
        'store_id',
        'email',
        'password',
        'name',
        'marketing_opt_in',
    ];

    /**
     * @var list<string>
     */
    protected $hidden = [
        'password_hash',
        'remember_token',
    ];

    public function getAuthPassword(): ?string
    {
        return $this->password_hash;
    }

    public function setPasswordAttribute(?string $value): void
    {
        $this->attributes['password_hash'] = $value && Hash::needsRehash($value) ? Hash::make($value) : $value;
    }

    public function getPasswordAttribute(): ?string
    {
        return $this->password_hash;
    }

    /**
     * @return HasMany<Cart, $this>
     */
    public function carts(): HasMany
    {
        return $this->hasMany(Cart::class);
    }

    /**
     * @return HasMany<Checkout, $this>
     */
    public function checkouts(): HasMany
    {
        return $this->hasMany(Checkout::class);
    }

    /**
     * @return HasMany<CustomerAddress, $this>
     */
    public function addresses(): HasMany
    {
        return $this->hasMany(CustomerAddress::class);
    }

    /**
     * @return HasMany<Order, $this>
     */
    public function orders(): HasMany
    {
        return $this->hasMany(Order::class);
    }

    /**
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'marketing_opt_in' => 'bool',
        ];
    }
}
<?php

namespace Database\Factories;

use App\Models\Store;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Customer>
 */
class CustomerFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'store_id' => Store::factory(),
            'email' => fake()->unique()->safeEmail(),
            'password' => 'password',
            'name' => fake()->name(),
            'marketing_opt_in' => false,
        ];
    }

    public function guest(): static
    {
        return $this->state(fn (array $attributes): array => [
            'password' => null,
        ]);
    }
}


command:
/bin/zsh
-lc
sed -n '1,180p' app/Support/Money.php

Money.php

cmd: sed -n '1,180p' app/Support/Money.php

aggregated_output:
<?php

namespace App\Support;

class Money
{
    public static function format(int $amount, string $currency = 'EUR'): string
    {
        return number_format($amount / 100, 2, '.', ',').' '.$currency;
    }

    public static function fromDecimalString(string|int|float|null $amount): int
    {
        if ($amount === null || $amount === '') {
            return 0;
        }

        return (int) round(((float) $amount) * 100);
    }
}


output:
Chunk ID: a8f564
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 111
Output:
<?php

namespace App\Support;

class Money
{
    public static function format(int $amount, string $currency = 'EUR'): string
    {
        return number_format($amount / 100, 2, '.', ',').' '.$currency;
    }

    public static function fromDecimalString(string|int|float|null $amount): int
    {
        if ($amount === null || $amount === '') {
            return 0;
        }

        return (int) round(((float) $amount) * 100);
    }
}


cmd: rg -n "Flux::modal|flux:modal" app resources tests vendor/livewire -g '*.php' -g '*.blade.php' | head -40


command: rg -n "Flux::modal|flux:modal" app resources tests vendor/livewire -g '*.php' -g '*.blade.php' | head -40

type: search

cmd: rg -n 'Flux::modal|flux:modal' app resources tests vendor/livewire -g '*.php' -g '*.blade.php'

query: Flux::modal|flux:modal

path: app

aggregated_output:
resources/views/layouts/storefront.blade.php:48:                    <flux:modal.trigger name="cart-drawer">
resources/views/layouts/storefront.blade.php:50:                    </flux:modal.trigger>
resources/views/livewire/settings/two-factor.blade.php:57:    <flux:modal
resources/views/livewire/settings/two-factor.blade.php:209:    </flux:modal>
resources/views/livewire/storefront/cart-drawer.blade.php:1:<flux:modal name="cart-drawer" class="md:w-[32rem]">
resources/views/livewire/storefront/cart-drawer.blade.php:70:</flux:modal>
resources/views/livewire/settings/delete-user-form.blade.php:7:    <flux:modal.trigger name="confirm-user-deletion">
resources/views/livewire/settings/delete-user-form.blade.php:11:    </flux:modal.trigger>
resources/views/livewire/settings/delete-user-form.blade.php:13:    <flux:modal name="confirm-user-deletion" :show="$errors->isNotEmpty()" focusable class="max-w-lg">
resources/views/livewire/settings/delete-user-form.blade.php:26:                <flux:modal.close>
resources/views/livewire/settings/delete-user-form.blade.php:28:                </flux:modal.close>
resources/views/livewire/settings/delete-user-form.blade.php:33:    </flux:modal>
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:62:// Support <flux:modal ... @close="?"> syntax...
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:69:// Support <flux:modal ... @cancel="?"> syntax...
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:101:                <flux:modal.close>
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:103:                </flux:modal.close>


output:
Chunk ID: 2dc563
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 414
Output:
resources/views/layouts/storefront.blade.php:48:                    <flux:modal.trigger name="cart-drawer">
resources/views/layouts/storefront.blade.php:50:                    </flux:modal.trigger>
resources/views/livewire/settings/two-factor.blade.php:57:    <flux:modal
resources/views/livewire/settings/two-factor.blade.php:209:    </flux:modal>
resources/views/livewire/storefront/cart-drawer.blade.php:1:<flux:modal name="cart-drawer" class="md:w-[32rem]">
resources/views/livewire/storefront/cart-drawer.blade.php:70:</flux:modal>
resources/views/livewire/settings/delete-user-form.blade.php:7:    <flux:modal.trigger name="confirm-user-deletion">
resources/views/livewire/settings/delete-user-form.blade.php:11:    </flux:modal.trigger>
resources/views/livewire/settings/delete-user-form.blade.php:13:    <flux:modal name="confirm-user-deletion" :show="$errors->isNotEmpty()" focusable class="max-w-lg">
resources/views/livewire/settings/delete-user-form.blade.php:26:                <flux:modal.close>
resources/views/livewire/settings/delete-user-form.blade.php:28:                </flux:modal.close>
resources/views/livewire/settings/delete-user-form.blade.php:33:    </flux:modal>
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:62:// Support <flux:modal ... @close="?"> syntax...
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:69:// Support <flux:modal ... @cancel="?"> syntax...
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:101:                <flux:modal.close>
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:103:                </flux:modal.close>


cmd: sed -n '1,110p' resources/views/livewire/settings/delete-user-form.blade.php && rg -n "class Flux|namespace Livewire\\Flux|Flux::" vendor/livewire/flux/src -g '*.php'


command: sed -n '1,110p' resources/views/livewire/settings/delete-user-form.blade.php && rg -n "class Flux|namespace Livewire\\Flux|Flux::" vendor/livewire/flux/src -g '*.php'

delete-user-form.blade.php

type: search

cmd: rg -n "class Flux|namespace Livewire\\\\Flux|Flux::" vendor/livewire/flux/src -g '*.php'

query: class Flux|namespace Livewire\\Flux|Flux::

path: flux

aggregated_output:
        <flux:heading>{{ __('Delete account') }}</flux:heading>
        <flux:subheading>{{ __('Delete your account and all of its resources') }}</flux:subheading>

    <flux:modal.trigger name="confirm-user-deletion">
        <flux:button variant="danger" x-data="" x-on:click.prevent="$dispatch('open-modal', 'confirm-user-deletion')">
            {{ __('Delete account') }}
        </flux:button>
    </flux:modal.trigger>

    <flux:modal name="confirm-user-deletion" :show="$errors->isNotEmpty()" focusable class="max-w-lg">
        <form method="POST" wire:submit="deleteUser" class="space-y-6">

                <flux:heading size="lg">{{ __('Are you sure you want to delete your account?') }}</flux:heading>

                <flux:subheading>
                    {{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.') }}
                </flux:subheading>

            <flux:input wire:model="password" :label="__('Password')" type="password" />

                <flux:modal.close>
                    <flux:button variant="filled">{{ __('Cancel') }}</flux:button>
                </flux:modal.close>

                <flux:button variant="danger" type="submit">{{ __('Delete account') }}</flux:button>

        </form>
    </flux:modal>

rg: regex parse error:
    (?:class Flux|namespace Livewire\Flux|Flux::)
                                    ^^
error: unrecognized escape sequence

status: failed


output:
Chunk ID: ce05a7
Wall time: 0.0000 seconds
Process exited with code 2
Original token count: 436
Output:

        <flux:heading>{{ __('Delete account') }}</flux:heading>
        <flux:subheading>{{ __('Delete your account and all of its resources') }}</flux:subheading>

    <flux:modal.trigger name="confirm-user-deletion">
        <flux:button variant="danger" x-data="" x-on:click.prevent="$dispatch('open-modal', 'confirm-user-deletion')">
            {{ __('Delete account') }}
        </flux:button>
    </flux:modal.trigger>

    <flux:modal name="confirm-user-deletion" :show="$errors->isNotEmpty()" focusable class="max-w-lg">
        <form method="POST" wire:submit="deleteUser" class="space-y-6">

                <flux:heading size="lg">{{ __('Are you sure you want to delete your account?') }}</flux:heading>

                <flux:subheading>
                    {{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.') }}
                </flux:subheading>

            <flux:input wire:model="password" :label="__('Password')" type="password" />

                <flux:modal.close>
                    <flux:button variant="filled">{{ __('Cancel') }}</flux:button>
                </flux:modal.close>

                <flux:button variant="danger" type="submit">{{ __('Delete account') }}</flux:button>

        </form>
    </flux:modal>

rg: regex parse error:
    (?:class Flux|namespace Livewire\Flux|Flux::)
                                    ^^
error: unrecognized escape sequence


cmd: rg -n 'Flux::|class Flux|namespace Livewire\\Flux|function modal' vendor/livewire/flux/src vendor/livewire/flux -g '*.php' | head -80


command: rg -n 'Flux::|class Flux|namespace Livewire\\Flux|function modal' vendor/livewire/flux/src vendor/livewire/flux -g '*.php' | head -80

type: search

cmd: rg -n "Flux::|class Flux|namespace Livewire\\\\Flux|function modal" vendor/livewire/flux/src vendor/livewire/flux -g '*.php'

query: Flux::|class Flux|namespace Livewire\\Flux|function modal

path: flux

aggregated_output:
vendor/livewire/flux/src/FluxManager.php:12:class FluxManager
vendor/livewire/flux/src/FluxManager.php:90:    // @deprecated - use extract(Flux::forwardedAttributes()) instead...
vendor/livewire/flux/src/FluxManager.php:12:class FluxManager
vendor/livewire/flux/src/FluxManager.php:90:    // @deprecated - use extract(Flux::forwardedAttributes()) instead...
vendor/livewire/flux/src/FluxServiceProvider.php:10:class FluxServiceProvider extends ServiceProvider
vendor/livewire/flux/src/FluxServiceProvider.php:19:        $loader->alias('Flux', \Flux\Flux::class);
vendor/livewire/flux/src/FluxServiceProvider.php:10:class FluxServiceProvider extends ServiceProvider
vendor/livewire/flux/src/FluxServiceProvider.php:19:        $loader->alias('Flux', \Flux\Flux::class);
vendor/livewire/flux/src/Console/IconCommand.php:111:        $classes = Flux::classes('shrink-0')
vendor/livewire/flux/src/Console/IconCommand.php:111:        $classes = Flux::classes('shrink-0')
vendor/livewire/flux/src/Flux.php:10:class Flux extends Facade
vendor/livewire/flux/src/AssetManager.php:45:        return Flux::pro()
vendor/livewire/flux/src/AssetManager.php:51:        return Flux::pro()
vendor/livewire/flux/src/AssetManager.php:57:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:63:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:69:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:76:        $manifest = Flux::pro()
vendor/livewire/flux/src/AssetManager.php:45:        return Flux::pro()
vendor/livewire/flux/src/AssetManager.php:51:        return Flux::pro()
vendor/livewire/flux/src/AssetManager.php:57:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:63:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:69:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:76:        $manifest = Flux::pro()
vendor/livewire/flux/src/Concerns/InteractsWithComponents.php:38:    public function modal($name)
vendor/livewire/flux/src/Concerns/InteractsWithComponents.php:55:    public function modals()
vendor/livewire/flux/src/Concerns/InteractsWithComponents.php:38:    public function modal($name)
vendor/livewire/flux/src/Concerns/InteractsWithComponents.php:55:    public function modals()
vendor/livewire/flux/src/Flux.php:10:class Flux extends Facade
vendor/livewire/flux/src/FluxTagCompiler.php:7:class FluxTagCompiler extends ComponentTagCompiler
vendor/livewire/flux/src/FluxTagCompiler.php:18:            return "<?php if (!Flux::componentExists(\$name = {$component})) throw new \Exception(\"Flux component [{\$name}] does not exist.\"); ?>##BEGIN-COMPONENT-CLASS##@component('{$class}', 'flux::' . {$component}, [
vendor/livewire/flux/src/FluxTagCompiler.php:7:class FluxTagCompiler extends ComponentTagCompiler
vendor/livewire/flux/src/FluxTagCompiler.php:18:            return "<?php if (!Flux::componentExists(\$name = {$component})) throw new \Exception(\"Flux component [{\$name}] does not exist.\"); ?>##BEGIN-COMPONENT-CLASS##@component('{$class}', 'flux::' . {$component}, [
vendor/livewire/flux/stubs/resources/views/flux/badge/close.blade.php:12:$iconClasses = Flux::classes()->add($iconVariant === 'outline' ? 'size-4' : '');
vendor/livewire/flux/stubs/resources/views/flux/badge/close.blade.php:14:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/badge/index.blade.php:24:$insetClasses = Flux::applyInset($inset, top: '-mt-1', right: '-me-2', bottom: '-mb-1', left: '-ms-2');
vendor/livewire/flux/stubs/resources/views/flux/badge/index.blade.php:27:$iconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/badge/index.blade.php:30:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/textarea.blade.php:11:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:13:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:19:$linkClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:23:$staticTextClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:27:$separatorClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:32:$iconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:37:[ $styleAttributes, $attributes ] = Flux::splitAttributes($attributes);
vendor/livewire/flux/stubs/resources/views/flux/description.blade.php:10:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/container.blade.php:4:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/indicator.blade.php:4:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/separator.blade.php:14:$classes = Flux::classes('border-0 [print-color-adjust:exact]')
vendor/livewire/flux/stubs/resources/views/flux/checkbox/group/variants/default.blade.php:2:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/group/variants/pills.blade.php:16:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/group/variants/cards.blade.php:16:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/accent.blade.php:8:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/group/variants/buttons.blade.php:16:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/index.blade.php:11:$variant = $variant !== 'default' && Flux::componentExists('checkbox.variants.' . $variant)
vendor/livewire/flux/stubs/resources/views/flux/footer.blade.php:4:$classes = Flux::classes('[grid-area:footer]')
vendor/livewire/flux/stubs/resources/views/flux/input/file.blade.php:4:extract(Flux::forwardedAttributes($attributes, [
vendor/livewire/flux/stubs/resources/views/flux/input/file.blade.php:18:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/input/file.blade.php:27:[ $styleAttributes, $attributes ] = Flux::splitAttributes($attributes);
vendor/livewire/flux/stubs/resources/views/flux/main.blade.php:8:$classes = Flux::classes('[grid-area:main]')
vendor/livewire/flux/stubs/resources/views/flux/skeleton/line.blade.php:11:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/switch.blade.php:14:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/switch.blade.php:26:$indicatorClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/button-or-link.blade.php:2:extract(Flux::forwardedAttributes($attributes, [
vendor/livewire/flux/stubs/resources/views/flux/skeleton/index.blade.php:10:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/fieldset.blade.php:9:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/link.blade.php:12:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/variants/default.blade.php:16:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/variants/cards.blade.php:18:$iconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/variants/cards.blade.php:24:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:22:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:42:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:80:[ $styleAttributes, $attributes ] = Flux::splitAttributes($attributes, ['autofocus', 'class', 'style', 'wire:close', 'x-on:close', 'wire:cancel', 'x-on:cancel']);
vendor/livewire/flux/stubs/resources/views/flux/menu/item.blade.php:19:$iconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/menu/item.blade.php:25:$trailingIconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/menu/item.blade.php:31:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/menu/item.blade.php:48:$suffixClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/input/group/prefix.blade.php:4:$classes = Flux::classes([
vendor/livewire/flux/stubs/resources/views/flux/text.blade.php:11:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/otp/index.blade.php:7:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/variants/buttons.blade.php:11:$classes = Flux::classes()


output:
Chunk ID: f8162d
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 2261
Output:
vendor/livewire/flux/src/FluxManager.php:12:class FluxManager
vendor/livewire/flux/src/FluxManager.php:90:    // @deprecated - use extract(Flux::forwardedAttributes()) instead...
vendor/livewire/flux/src/FluxManager.php:12:class FluxManager
vendor/livewire/flux/src/FluxManager.php:90:    // @deprecated - use extract(Flux::forwardedAttributes()) instead...
vendor/livewire/flux/src/FluxServiceProvider.php:10:class FluxServiceProvider extends ServiceProvider
vendor/livewire/flux/src/FluxServiceProvider.php:19:        $loader->alias('Flux', \Flux\Flux::class);
vendor/livewire/flux/src/FluxServiceProvider.php:10:class FluxServiceProvider extends ServiceProvider
vendor/livewire/flux/src/FluxServiceProvider.php:19:        $loader->alias('Flux', \Flux\Flux::class);
vendor/livewire/flux/src/Console/IconCommand.php:111:        $classes = Flux::classes('shrink-0')
vendor/livewire/flux/src/Console/IconCommand.php:111:        $classes = Flux::classes('shrink-0')
vendor/livewire/flux/src/Flux.php:10:class Flux extends Facade
vendor/livewire/flux/src/AssetManager.php:45:        return Flux::pro()
vendor/livewire/flux/src/AssetManager.php:51:        return Flux::pro()
vendor/livewire/flux/src/AssetManager.php:57:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:63:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:69:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:76:        $manifest = Flux::pro()
vendor/livewire/flux/src/AssetManager.php:45:        return Flux::pro()
vendor/livewire/flux/src/AssetManager.php:51:        return Flux::pro()
vendor/livewire/flux/src/AssetManager.php:57:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:63:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:69:        if (! Flux::pro()) throw new \Exception('Flux Pro is required to use the Flux editor.');
vendor/livewire/flux/src/AssetManager.php:76:        $manifest = Flux::pro()
vendor/livewire/flux/src/Concerns/InteractsWithComponents.php:38:    public function modal($name)
vendor/livewire/flux/src/Concerns/InteractsWithComponents.php:55:    public function modals()
vendor/livewire/flux/src/Concerns/InteractsWithComponents.php:38:    public function modal($name)
vendor/livewire/flux/src/Concerns/InteractsWithComponents.php:55:    public function modals()
vendor/livewire/flux/src/Flux.php:10:class Flux extends Facade
vendor/livewire/flux/src/FluxTagCompiler.php:7:class FluxTagCompiler extends ComponentTagCompiler
vendor/livewire/flux/src/FluxTagCompiler.php:18:            return "<?php if (!Flux::componentExists(\$name = {$component})) throw new \Exception(\"Flux component [{\$name}] does not exist.\"); ?>##BEGIN-COMPONENT-CLASS##@component('{$class}', 'flux::' . {$component}, [
vendor/livewire/flux/src/FluxTagCompiler.php:7:class FluxTagCompiler extends ComponentTagCompiler
vendor/livewire/flux/src/FluxTagCompiler.php:18:            return "<?php if (!Flux::componentExists(\$name = {$component})) throw new \Exception(\"Flux component [{\$name}] does not exist.\"); ?>##BEGIN-COMPONENT-CLASS##@component('{$class}', 'flux::' . {$component}, [
vendor/livewire/flux/stubs/resources/views/flux/badge/close.blade.php:12:$iconClasses = Flux::classes()->add($iconVariant === 'outline' ? 'size-4' : '');
vendor/livewire/flux/stubs/resources/views/flux/badge/close.blade.php:14:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/badge/index.blade.php:24:$insetClasses = Flux::applyInset($inset, top: '-mt-1', right: '-me-2', bottom: '-mb-1', left: '-ms-2');
vendor/livewire/flux/stubs/resources/views/flux/badge/index.blade.php:27:$iconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/badge/index.blade.php:30:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/textarea.blade.php:11:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:13:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:19:$linkClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:23:$staticTextClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:27:$separatorClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:32:$iconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/breadcrumbs/item.blade.php:37:[ $styleAttributes, $attributes ] = Flux::splitAttributes($attributes);
vendor/livewire/flux/stubs/resources/views/flux/description.blade.php:10:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/container.blade.php:4:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/indicator.blade.php:4:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/separator.blade.php:14:$classes = Flux::classes('border-0 [print-color-adjust:exact]')
vendor/livewire/flux/stubs/resources/views/flux/checkbox/group/variants/default.blade.php:2:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/group/variants/pills.blade.php:16:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/group/variants/cards.blade.php:16:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/accent.blade.php:8:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/group/variants/buttons.blade.php:16:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/index.blade.php:11:$variant = $variant !== 'default' && Flux::componentExists('checkbox.variants.' . $variant)
vendor/livewire/flux/stubs/resources/views/flux/footer.blade.php:4:$classes = Flux::classes('[grid-area:footer]')
vendor/livewire/flux/stubs/resources/views/flux/input/file.blade.php:4:extract(Flux::forwardedAttributes($attributes, [
vendor/livewire/flux/stubs/resources/views/flux/input/file.blade.php:18:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/input/file.blade.php:27:[ $styleAttributes, $attributes ] = Flux::splitAttributes($attributes);
vendor/livewire/flux/stubs/resources/views/flux/main.blade.php:8:$classes = Flux::classes('[grid-area:main]')
vendor/livewire/flux/stubs/resources/views/flux/skeleton/line.blade.php:11:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/switch.blade.php:14:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/switch.blade.php:26:$indicatorClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/button-or-link.blade.php:2:extract(Flux::forwardedAttributes($attributes, [
vendor/livewire/flux/stubs/resources/views/flux/skeleton/index.blade.php:10:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/fieldset.blade.php:9:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/link.blade.php:12:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/variants/default.blade.php:16:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/variants/cards.blade.php:18:$iconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/variants/cards.blade.php:24:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:22:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:42:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/modal/index.blade.php:80:[ $styleAttributes, $attributes ] = Flux::splitAttributes($attributes, ['autofocus', 'class', 'style', 'wire:close', 'x-on:close', 'wire:cancel', 'x-on:cancel']);
vendor/livewire/flux/stubs/resources/views/flux/menu/item.blade.php:19:$iconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/menu/item.blade.php:25:$trailingIconClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/menu/item.blade.php:31:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/menu/item.blade.php:48:$suffixClasses = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/input/group/prefix.blade.php:4:$classes = Flux::classes([
vendor/livewire/flux/stubs/resources/views/flux/text.blade.php:11:$classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/otp/index.blade.php:7:    $classes = Flux::classes()
vendor/livewire/flux/stubs/resources/views/flux/checkbox/variants/buttons.blade.php:11:$classes = Flux::classes()


cmd: sed -n '1,90p' vendor/livewire/flux/src/Flux.php && sed -n '1,100p' vendor/livewire/flux/src/Concerns/InteractsWithComponents.php


command: sed -n '1,90p' vendor/livewire/flux/src/Flux.php && sed -n '1,100p' vendor/livewire/flux/src/Concerns/InteractsWithComponents.php

InteractsWithComponents.php

aggregated_output:
<?php

namespace Flux;

use Illuminate\Support\Facades\Facade;

/**
 * @see \Flux\FluxManager
 */
class Flux extends Facade
{
    public static function getFacadeAccessor()
    {
        return 'flux';
    }
}
<?php

namespace Flux\Concerns;

use Livewire\Component;
use Flux\Flux;

trait InteractsWithComponents
{
    public function bootComponents()
    {
        $this->bootModal();
    }

    public function bootModal()
    {
        Component::macro('modal', function ($name) {
            return new class ($name) {
                public function __construct(public $name) {}

                public function show()
                {
                    $component = app('livewire')->current();

                    $component->dispatch('modal-show', name: $this->name, scope: $component->getId());
                }

                public function close()
                {
                    $component = app('livewire')->current();

                    $component->dispatch('modal-close', name: $this->name, scope: $component->getId());
                }
            };
        });
    }

    public function modal($name)
    {
        return new class ($name) {
            public function __construct(public $name) {}

            public function show()
            {
                app('livewire')->current()->dispatch('modal-show', name: $this->name);
            }

            public function close()
            {
                app('livewire')->current()->dispatch('modal-close', name: $this->name);
            }
        };
    }

    public function modals()
    {
        return new class {
            public function close()
            {
                app('livewire')->current()->dispatch('modal-close');
            }
        };
    }

    public function toast($text, $heading = null, $duration = 5000, $variant = null, $position = null)
    {
        $params = [
            'duration' => $duration,
            'slots' => [],
            'dataset' => [],
        ];

        if ($text) $params['slots']['text'] = $text;
        if ($heading) $params['slots']['heading'] = $heading;
        if ($variant) $params['dataset']['variant'] = $variant;
        if ($position) $params['dataset']['position'] = $position;

        app('livewire')->current()->dispatch('toast-show', ...$params);
    }
}


output:
Chunk ID: d5462d
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 583
Output:
<?php

namespace Flux;

use Illuminate\Support\Facades\Facade;

/**
 * @see \Flux\FluxManager
 */
class Flux extends Facade
{
    public static function getFacadeAccessor()
    {
        return 'flux';
    }
}
<?php

namespace Flux\Concerns;

use Livewire\Component;
use Flux\Flux;

trait InteractsWithComponents
{
    public function bootComponents()
    {
        $this->bootModal();
    }

    public function bootModal()
    {
        Component::macro('modal', function ($name) {
            return new class ($name) {
                public function __construct(public $name) {}

                public function show()
                {
                    $component = app('livewire')->current();

                    $component->dispatch('modal-show', name: $this->name, scope: $component->getId());
                }

                public function close()
                {
                    $component = app('livewire')->current();

                    $component->dispatch('modal-close', name: $this->name, scope: $component->getId());
                }
            };
        });
    }

    public function modal($name)
    {
        return new class ($name) {
            public function __construct(public $name) {}

            public function show()
            {
                app('livewire')->current()->dispatch('modal-show', name: $this->name);
            }

            public function close()
            {
                app('livewire')->current()->dispatch('modal-close', name: $this->name);
            }
        };
    }

    public function modals()
    {
        return new class {
            public function close()
            {
                app('livewire')->current()->dispatch('modal-close');
            }
        };
    }

    public function toast($text, $heading = null, $duration = 5000, $variant = null, $position = null)
    {
        $params = [
            'duration' => $duration,
            'slots' => [],
            'dataset' => [],
        ];

        if ($text) $params['slots']['text'] = $text;
        if ($heading) $params['slots']['heading'] = $heading;
        if ($variant) $params['dataset']['variant'] = $variant;
        if ($position) $params['dataset']['position'] = $position;

        app('livewire')->current()->dispatch('toast-show', ...$params);
    }
}


cmd: sed -n '1,80p' app/Exceptions/InvalidOrderOperationException.php && sed -n '1,80p' app/Exceptions/InvalidRefundOperationException.php && sed -n '1,80p' app/Exceptions/InvalidFulfillmentOperationException.php


command: sed -n '1,80p' app/Exceptions/InvalidOrderOperationException.php && sed -n '1,80p' app/Exceptions/InvalidRefundOperationException.php && sed -n '1,80p' app/Exceptions/InvalidFulfillmentOperationException.php

InvalidRefundOperationException.php

aggregated_output:
<?php

namespace App\Exceptions;

use RuntimeException;

class InvalidOrderOperationException extends RuntimeException
{
    public static function because(string $reason): self
    {
        return new self($reason);
    }
}
<?php

namespace App\Exceptions;

use RuntimeException;

class InvalidRefundOperationException extends RuntimeException
{
    public static function because(string $reason): self
    {
        return new self($reason);
    }
}
<?php

namespace App\Exceptions;

use RuntimeException;

class InvalidFulfillmentOperationException extends RuntimeException
{
    public static function because(string $reason): self
    {
        return new self($reason);
    }
}


output:
Chunk ID: 7c27d8
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 172
Output:
<?php

namespace App\Exceptions;

use RuntimeException;

class InvalidOrderOperationException extends RuntimeException
{
    public static function because(string $reason): self
    {
        return new self($reason);
    }
}
<?php

namespace App\Exceptions;

use RuntimeException;

class InvalidRefundOperationException extends RuntimeException
{
    public static function because(string $reason): self
    {
        return new self($reason);
    }
}
<?php

namespace App\Exceptions;

use RuntimeException;

class InvalidFulfillmentOperationException extends RuntimeException
{
    public static function because(string $reason): self
    {
        return new self($reason);
    }
}


message: I have enough context. I’m going to add two admin Livewire pages: an order index with scoped filters/search, and an order detail page with service-backed bank-transfer confirmation, refunds, fulfillments, and shipment transitions. Tests will exercise each action directly through Livewire.

phase: commentary


type: message

role: assistant

text: I have enough context. I’m going to add two admin Livewire pages: an order index with scoped filters/search, and an order detail page with service-backed bank-transfer confirmation, refunds, fulfillments, and shipment transitions. Tests will exercise each action directly through Livewire.


status: completed

input:
*** Begin Patch
*** Update File: /Users/fabianwesner/Herd/shop/app/Livewire/Admin/Orders/Index.php
@@
 namespace App\Livewire\Admin\Orders;

+use App\Enums\FinancialStatus;
+use App\Enums\FulfillmentStatus;
+use App\Enums\OrderStatus;
+use App\Models\Order;
+use App\Models\Store;
+use Illuminate\Contracts\Pagination\LengthAwarePaginator;
+use Illuminate\Database\Eloquent\Builder;
+use Illuminate\Support\Carbon;
+use Livewire\Attributes\Locked;
 use Livewire\Component;
+use Livewire\WithPagination;

 class Index extends Component
 {
-    public function render()
+    use WithPagination;
+
+    #[Locked]
+    public int $storeId;
+
+    public string $search = '';
+
+    public string $statusFilter = 'all';
+
+    public string $financialStatusFilter = 'all';
+
+    public string $fulfillmentStatusFilter = 'all';
+
+    public string $dateFrom = '';
+
+    public string $dateTo = '';
+
+    public function mount(): void
     {
-        return view('livewire.admin.orders.index');
+        $store = app('current_store');
+
+        abort_unless($store instanceof Store, 404);
+
+        $this->storeId = $store->getKey();
+    }
+
+    public function updatedSearch(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedStatusFilter(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedFinancialStatusFilter(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedFulfillmentStatusFilter(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedDateFrom(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedDateTo(): void
+    {
+        $this->resetPage();
+    }
+
+    public function orders(): LengthAwarePaginator
+    {
+        return Order::withoutGlobalScopes()
+            ->with('customer')
+            ->withCount('lines')
+            ->where('store_id', $this->storeId)
+            ->when($this->search !== '', function (Builder $query): void {
+                $search = '%'.$this->search.'%';
+
+                $query->where(function (Builder $query) use ($search): void {
+                    $query
+                        ->where('order_number', 'like', $search)
+                        ->orWhere('email', 'like', $search)
+                        ->orWhereHas('customer', fn (Builder $query) => $query->where('name', 'like', $search));
+                });
+            })
+            ->when($this->statusFilter !== 'all', fn (Builder $query) => $query->where('status', $this->statusFilter))
+            ->when($this->financialStatusFilter !== 'all', fn (Builder $query) => $query->where('financial_status', $this->financialStatusFilter))
+            ->when($this->fulfillmentStatusFilter !== 'all', fn (Builder $query) => $query->where('fulfillment_status', $this->fulfillmentStatusFilter))
+            ->when($this->dateFrom !== '', fn (Builder $query) => $query->where('placed_at', '>=', Carbon::parse($this->dateFrom)->startOfDay()))
+            ->when($this->dateTo !== '', fn (Builder $query) => $query->where('placed_at', '<=', Carbon::parse($this->dateTo)->endOfDay()))
+            ->latest('placed_at')
+            ->latest('id')
+            ->paginate(20);
+    }
+
+    public function render(): mixed
+    {
+        return view('livewire.admin.orders.index', [
+            'orders' => $this->orders(),
+            'statuses' => OrderStatus::cases(),
+            'financialStatuses' => FinancialStatus::cases(),
+            'fulfillmentStatuses' => FulfillmentStatus::cases(),
+        ])->layout('layouts.app', [
+            'title' => __('Orders'),
+        ]);
     }
 }
*** End Patch


stdout:
Success. Updated the following files:
M /Users/fabianwesner/Herd/shop/app/Livewire/Admin/Orders/Index.php

type: update

unified_diff:
@@ -4,3 +4,13 @@

+use App\Enums\FinancialStatus;
+use App\Enums\FulfillmentStatus;
+use App\Enums\OrderStatus;
+use App\Models\Order;
+use App\Models\Store;
+use Illuminate\Contracts\Pagination\LengthAwarePaginator;
+use Illuminate\Database\Eloquent\Builder;
+use Illuminate\Support\Carbon;
+use Livewire\Attributes\Locked;
 use Livewire\Component;
+use Livewire\WithPagination;

@@ -8,5 +18,94 @@
 {
-    public function render()
+    use WithPagination;
+
+    #[Locked]
+    public int $storeId;
+
+    public string $search = '';
+
+    public string $statusFilter = 'all';
+
+    public string $financialStatusFilter = 'all';
+
+    public string $fulfillmentStatusFilter = 'all';
+
+    public string $dateFrom = '';
+
+    public string $dateTo = '';
+
+    public function mount(): void
+    {
+        $store = app('current_store');
+
+        abort_unless($store instanceof Store, 404);
+
+        $this->storeId = $store->getKey();
+    }
+
+    public function updatedSearch(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedStatusFilter(): void
     {
-        return view('livewire.admin.orders.index');
+        $this->resetPage();
+    }
+
+    public function updatedFinancialStatusFilter(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedFulfillmentStatusFilter(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedDateFrom(): void
+    {
+        $this->resetPage();
+    }
+
+    public function updatedDateTo(): void
+    {
+        $this->resetPage();
+    }
+
+    public function orders(): LengthAwarePaginator
+    {
+        return Order::withoutGlobalScopes()
+            ->with('customer')
+            ->withCount('lines')
+            ->where('store_id', $this->storeId)
+            ->when($this->search !== '', function (Builder $query): void {
+                $search = '%'.$this->search.'%';
+
+                $query->where(function (Builder $query) use ($search): void {
+                    $query
+                        ->where('order_number', 'like', $search)
+                        ->orWhere('email', 'like', $search)
+                        ->orWhereHas('customer', fn (Builder $query) => $query->where('name', 'like', $search));
+                });
+            })
+            ->when($this->statusFilter !== 'all', fn (Builder $query) => $query->where('status', $this->statusFilter))
+            ->when($this->financialStatusFilter !== 'all', fn (Builder $query) => $query->where('financial_status', $this->financialStatusFilter))
+            ->when($this->fulfillmentStatusFilter !== 'all', fn (Builder $query) => $query->where('fulfillment_status', $this->fulfillmentStatusFilter))
+            ->when($this->dateFrom !== '', fn (Builder $query) => $query->where('placed_at', '>=', Carbon::parse($this->dateFrom)->startOfDay()))
+            ->when($this->dateTo !== '', fn (Builder $query) => $query->where('placed_at', '<=', Carbon::parse($this->dateTo)->endOfDay()))
+            ->latest('placed_at')
+            ->latest('id')
+            ->paginate(20);
+    }
+
+    public function render(): mixed
+    {
+        return view('livewire.admin.orders.index', [
+            'orders' => $this->orders(),
+            'statuses' => OrderStatus::cases(),
+            'financialStatuses' => FinancialStatus::cases(),
+            'fulfillmentStatuses' => FulfillmentStatus::cases(),
+        ])->layout('layouts.app', [
+            'title' => __('Orders'),
+        ]);
     }


output: {"output":"Success. Updated the following files:\nM /Users/fabianwesner/Herd/shop/app/Livewire/Admin/Orders/Index.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Update File: /Users/fabianwesner/Herd/shop/app/Livewire/Admin/Orders/Show.php
@@
 namespace App\Livewire\Admin\Orders;

+use App\Enums\RefundStatus;
+use App\Exceptions\InvalidFulfillmentOperationException;
+use App\Exceptions\InvalidOrderOperationException;
+use App\Exceptions\InvalidRefundOperationException;
+use App\Models\Fulfillment;
+use App\Models\Order;
+use App\Models\OrderLine;
+use App\Models\Refund;
+use App\Models\Store;
+use App\Services\FulfillmentService;
+use App\Services\OrderService;
+use App\Services\RefundService;
+use App\Support\Money;
+use Illuminate\Validation\ValidationException;
+use Livewire\Attributes\Locked;
 use Livewire\Component;

 class Show extends Component
 {
-    public function render()
+    #[Locked]
+    public int $storeId;
+
+    #[Locked]
+    public int $orderId;
+
+    public string $refundAmount = '';
+
+    public string $refundReason = '';
+
+    /**
+     * @var array<int, int>
+     */
+    public array $fulfillmentLineQuantities = [];
+
+    public string $trackingCompany = '';
+
+    public string $trackingNumber = '';
+
+    public string $trackingUrl = '';
+
+    public function mount(Order $order): void
     {
-        return view('livewire.admin.orders.show');
+        $store = app('current_store');
+
+        abort_unless($store instanceof Store, 404);
+
+        $order = Order::withoutGlobalScopes()
+            ->where('store_id', $store->getKey())
+            ->whereKey($order->getKey())
+            ->first();
+
+        abort_unless($order instanceof Order, 404);
+
+        $this->storeId = $store->getKey();
+        $this->orderId = $order->getKey();
+        $this->resetFulfillmentLineQuantities($this->order());
+    }
+
+    public function confirmBankTransferPayment(OrderService $orders): void
+    {
+        try {
+            $orders->confirmBankTransferPayment($this->order());
+            $this->resetFulfillmentLineQuantities($this->order());
+            $this->dispatch('toast', type: 'success', message: __('Payment confirmed'));
+        } catch (InvalidOrderOperationException $exception) {
+            throw ValidationException::withMessages([
+                'orderAction' => $exception->getMessage(),
+            ]);
+        }
+    }
+
+    public function processRefund(RefundService $refunds): void
+    {
+        $this->validate([
+            'refundAmount' => ['nullable', 'numeric', 'min:0.01'],
+            'refundReason' => ['nullable', 'string', 'max:500'],
+        ]);
+
+        $request = [
+            'reason' => $this->refundReason !== '' ? $this->refundReason : null,
+        ];
+
+        if ($this->refundAmount !== '') {
+            $request['amount'] = Money::fromDecimalString($this->refundAmount);
+        }
+
+        try {
+            $refunds->process($this->order(), $request);
+            $this->refundAmount = '';
+            $this->refundReason = '';
+            $this->modal('refund-order')->close();
+            $this->dispatch('toast', type: 'success', message: __('Refund processed'));
+        } catch (InvalidRefundOperationException $exception) {
+            throw ValidationException::withMessages([
+                'refundAmount' => $exception->getMessage(),
+            ]);
+        }
+    }
+
+    public function createFulfillment(FulfillmentService $fulfillments): void
+    {
+        $this->validate([
+            'fulfillmentLineQuantities' => ['array'],
+            'trackingCompany' => ['nullable', 'string', 'max:255'],
+            'trackingNumber' => ['nullable', 'string', 'max:255'],
+            'trackingUrl' => ['nullable', 'url', 'max:2048'],
+        ]);
+
+        $lines = collect($this->fulfillmentLineQuantities)
+            ->mapWithKeys(fn (mixed $quantity, int|string $lineId): array => [(int) $lineId => (int) $quantity])
+            ->filter(fn (int $quantity): bool => $quantity > 0)
+            ->all();
+
+        if ($lines === []) {
+            throw ValidationException::withMessages([
+                'fulfillment' => __('At least one fulfillment line is required.'),
+            ]);
+        }
+
+        try {
+            $fulfillments->create($this->order(), $lines, [
+                'tracking_company' => $this->trackingCompany !== '' ? $this->trackingCompany : null,
+                'tracking_number' => $this->trackingNumber !== '' ? $this->trackingNumber : null,
+                'tracking_url' => $this->trackingUrl !== '' ? $this->trackingUrl : null,
+            ]);
+
+            $this->trackingCompany = '';
+            $this->trackingNumber = '';
+            $this->trackingUrl = '';
+            $this->resetFulfillmentLineQuantities($this->order());
+            $this->modal('fulfillment-order')->close();
+            $this->dispatch('toast', type: 'success', message: __('Fulfillment created'));
+        } catch (InvalidFulfillmentOperationException $exception) {
+            throw ValidationException::withMessages([
+                'fulfillment' => $exception->getMessage(),
+            ]);
+        }
+    }
+
+    public function markFulfillmentShipped(int $fulfillmentId, FulfillmentService $fulfillments): void
+    {
+        try {
+            $fulfillments->markShipped($this->fulfillment($fulfillmentId));
+            $this->dispatch('toast', type: 'success', message: __('Fulfillment marked as shipped'));
+        } catch (InvalidFulfillmentOperationException $exception) {
+            throw ValidationException::withMessages([
+                'fulfillment' => $exception->getMessage(),
+            ]);
+        }
+    }
+
+    public function markFulfillmentDelivered(int $fulfillmentId, FulfillmentService $fulfillments): void
+    {
+        try {
+            $fulfillments->markDelivered($this->fulfillment($fulfillmentId));
+            $this->dispatch('toast', type: 'success', message: __('Fulfillment marked as delivered'));
+        } catch (InvalidFulfillmentOperationException $exception) {
+            throw ValidationException::withMessages([
+                'fulfillment' => $exception->getMessage(),
+            ]);
+        }
+    }
+
+    public function render(): mixed
+    {
+        $order = $this->order();
+
+        return view('livewire.admin.orders.show', [
+            'order' => $order,
+            'remainingFulfillmentQuantities' => $this->remainingFulfillmentQuantities($order),
+            'refundableAmount' => $this->refundableAmount($order),
+        ])->layout('layouts.app', [
+            'title' => $order->order_number,
+        ]);
+    }
+
+    private function order(): Order
+    {
+        return Order::withoutGlobalScopes()
+            ->with([
+                'customer',
+                'lines.fulfillmentLines',
+                'payments',
+                'refunds',
+                'fulfillments.lines.orderLine',
+            ])
+            ->where('store_id', $this->storeId)
+            ->whereKey($this->orderId)
+            ->firstOrFail();
+    }
+
+    private function fulfillment(int $fulfillmentId): Fulfillment
+    {
+        $fulfillment = $this->order()
+            ->fulfillments
+            ->firstWhere('id', $fulfillmentId);
+
+        abort_unless($fulfillment instanceof Fulfillment, 404);
+
+        return $fulfillment;
+    }
+
+    /**
+     * @return array<int, int>
+     */
+    private function remainingFulfillmentQuantities(Order $order): array
+    {
+        return $order->lines
+            ->mapWithKeys(function (OrderLine $line): array {
+                $fulfilled = $line->fulfillmentLines->sum('quantity');
+
+                return [$line->getKey() => max(0, $line->quantity - $fulfilled)];
+            })
+            ->all();
+    }
+
+    private function resetFulfillmentLineQuantities(Order $order): void
+    {
+        $this->fulfillmentLineQuantities = $this->remainingFulfillmentQuantities($order);
+    }
+
+    private function refundableAmount(Order $order): int
+    {
+        $refunded = $order->refunds
+            ->reject(fn (Refund $refund): bool => $refund->status === RefundStatus::Failed)
+            ->sum('amount');
+
+        return max(0, $order->total_amount - $refunded);
     }
 }
*** End Patch