Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/document-facades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
extensions: :php-psr
tools: composer:v2
coverage: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fix-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
tools: composer:v2, pint
- name: Run Pint
run: pint --parallel --diff=origin/1.x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.3", "8.4"]
php: ${{ fromJSON(github.event_name == 'pull_request' && '["8.4"]' || '["8.4","8.5"]') }}
laravel: ["^12.0", "^13.0"]
dependencies: ["highest"]
name: "PHP ${{ matrix.php }} - L${{ matrix.laravel }} ${{ matrix.dependencies == 'highest' && '↑' || '↓' }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
# PRs run a slimmed matrix; push and the schedule run the full one.
php: ${{ fromJSON(github.event_name == 'pull_request' && '["8.4"]' || '["8.3","8.4"]') }}
php: ${{ fromJSON(github.event_name == 'pull_request' && '["8.4"]' || '["8.4","8.5"]') }}
laravel: ["12.*", "13.*"]
dependency-version: [prefer-stable]
testsuite: [core, admin, filament, shipping, stripe, search, upgrade]
Expand Down
3 changes: 1 addition & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Each item below should have a written spec in `specs/` (alongside this file in t

## Outstanding

- Implement state machines, replacing soft-deletes
- Specifically, products (draft, published, archived) & orders (payment, fulfilment and order status)
- Region concept to define channel, currency, language, tax_zone, countries and price display
- `StorefrontContext` for CartSessionManager and other services
- Add Vendors concept to support marketplace developments
Expand Down Expand Up @@ -54,3 +52,4 @@ Each item below should have a written spec in `specs/` (alongside this file in t
- Change `compare_price` to `list_price`
- Add dedicated `name` / `description` / `short_description` fields — promote Product/Collection name + description out of `attribute_data` into translatable columns and add a translatable `short_description`; Brand gains translatable description/short_description but keeps a plain string name; reads route through `translate()`, search indexes per locale, Filament binds explicit fields; one-way v1→v2 backfill migration + `translateAttribute`→`translate` Rector rule (spec 0018)
- Attribute system redesign — id-keyed raw `attribute_data` JSON on disk + handle-keyed `FieldType` collection in memory; drop the morph columns on `Attribute` / `AttributeGroup` for a nullable group FK + typed `attribute_models` join + renamed `product_type_attribute` pivot; shared `AbstractFieldType` base + `FieldTypeEnum` + relocated `Manifests\FieldTypeManifest`; `AttributeCache` + observer + `PurgeAttributeData` job keep the new shape consistent; one-way v1→v2 data migration + Rector renames in the upgrade package (spec 0019)
- State machines — `spatie/laravel-model-states` v2 across core. Channel (Active/Inactive), Product/Collection (Draft/Published/Archived), Order's three coordinated machines (Payment, Fulfilment, Order) with `OnHold`/`Cancelled` manual overrides. `OrderStateConfig` contract is the single seam for adding bespoke states, transitions, notifications and resolver overrides. `SoftDeletes` retired from Product/ProductVariant/Channel/Collection; baseline migrations edited in place. PHP minimum bumped to 8.4 due to upstream `spatie/laravel-model-states` PHP/Laravel matrix split (spec 0021)
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
"lunarphp/admin": "self.version",
"lunarphp/filament": "self.version",
"meilisearch/meilisearch-php": "^1.10",
"php": "^8.3",
"php": "^8.4",
"spatie/laravel-activitylog": "^4.10.1",
"spatie/laravel-blink": "^1.7.1",
"spatie/laravel-data": "^4.13.1",
"spatie/laravel-medialibrary": "^11.12.7",
"spatie/laravel-model-states": "^2.11",
"spatie/laravel-permission": "^6.12",
"spatie/php-structure-discoverer": "^2.3.1",
"stripe/stripe-php": "^16.0",
Expand Down
7 changes: 4 additions & 3 deletions packages/admin/config/panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
|--------------------------------------------------------------------------
|
| The admin panel will show a count of orders in the left navigation.
| This is based upon specific order statuses. You can define the statuses
| to include in the count below.
| This is based upon specific order status values. You can define the
| statuses to include in the count below — see Lunar\Core\States\Order\Order
| for the registered states (the static $name on each concrete class).
|
*/
'order_count_statuses' => ['payment-received'],
'order_count_statuses' => ['in-process'],

];
8 changes: 8 additions & 0 deletions packages/admin/resources/lang/ar/channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@
'label' => 'افتراضي',
],
],
'actions' => [
'delete' => [
'confirm' => 'This permanently deletes the channel and cannot be undone. If you want to stop using it without losing it, mark it Inactive instead.',
'blocked' => 'This channel has orders associated with it and cannot be deleted — mark it Inactive instead so historical orders keep their context.',
'disabled_tooltip' => 'Channels with order history can\'t be deleted. Mark Inactive instead.',
],
],

];
4 changes: 2 additions & 2 deletions packages/admin/resources/lang/ar/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
'label' => 'الرقم المرجعي',
],
'status' => [
'label' => 'الحالة',
'label' => 'Order',
],
'transaction' => [
'label' => 'المعاملة',
Expand Down Expand Up @@ -165,7 +165,7 @@
'message' => 'وقت الطلب: :count',
],
'status' => [
'label' => 'الحالة',
'label' => 'Order',
],
'reference' => [
'label' => 'الرقم المرجعي',
Expand Down
14 changes: 11 additions & 3 deletions packages/admin/resources/lang/ar/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
'all' => 'الكل',
'published' => 'منشور',
'draft' => 'مسودة',
'archived' => 'Archived',
],
'status' => [
'unpublished' => [
'content' => 'حالياً في حالة مسودة، هذا المنتج غير متاح في جميع واجهات البيع ومجموعات العملاء.',
],
'availability' => [
'customer_groups' => 'هذا المنتج غير متاح حالياً لجميع مجموعات العملاء.',
'channels' => 'هذا المنتج غير متاح حالياً لجميع واجهات البيع.',
Expand Down Expand Up @@ -47,8 +45,14 @@
'actions' => [
'edit_status' => [
'label' => 'تحديث الحالة',
'label_with_state' => 'Status: :state',
'heading' => 'تحديث الحالة',
],
'delete' => [
'confirm' => 'This permanently deletes the product and cannot be undone. If you want to hide it from the storefront without losing it, archive it instead.',
'blocked' => 'This product has appeared on past orders and cannot be deleted — archive it instead so historical orders keep their reference.',
'disabled_tooltip' => 'Products with order history can\'t be deleted. Archive instead.',
],
],
'form' => [
'name' => [
Expand All @@ -74,6 +78,10 @@
'label' => 'Draft',
'description' => 'سيكون هذا المنتج مخفيًا في جميع القنوات ومجموعات العملاء',
],
'archived' => [
'label' => 'Archived',
'description' => 'This product is retired but still referenced by historical orders. Move back to Draft to revive it.',
],
],
],
'tags' => [
Expand Down
8 changes: 8 additions & 0 deletions packages/admin/resources/lang/bg/channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@
'label' => 'По подразбиране',
],
],
'actions' => [
'delete' => [
'confirm' => 'This permanently deletes the channel and cannot be undone. If you want to stop using it without losing it, mark it Inactive instead.',
'blocked' => 'This channel has orders associated with it and cannot be deleted — mark it Inactive instead so historical orders keep their context.',
'disabled_tooltip' => 'Channels with order history can\'t be deleted. Mark Inactive instead.',
],
],

];
4 changes: 2 additions & 2 deletions packages/admin/resources/lang/bg/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
'label' => 'Референция',
],
'status' => [
'label' => 'Статус',
'label' => 'Order',
],
'transaction' => [
'label' => 'Транзакция',
Expand Down Expand Up @@ -165,7 +165,7 @@
'message' => 'по време на поръчката: :count',
],
'status' => [
'label' => 'Статус',
'label' => 'Order',
],
'reference' => [
'label' => 'Референция',
Expand Down
14 changes: 11 additions & 3 deletions packages/admin/resources/lang/bg/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
'all' => 'Всички',
'published' => 'Публикувани',
'draft' => 'Чернови',
'archived' => 'Archived',
],
'status' => [
'unpublished' => [
'content' => 'В чернова, този продукт е недостъпен във всички канали и клиентски групи.',
],
'availability' => [
'customer_groups' => 'Този продукт не е наличен за всички клиентски групи.',
'channels' => 'Този продукт не е наличен във всички канали.',
Expand Down Expand Up @@ -47,8 +45,14 @@
'actions' => [
'edit_status' => [
'label' => 'Актуализиране на статус',
'label_with_state' => 'Status: :state',
'heading' => 'Актуализиране на статус',
],
'delete' => [
'confirm' => 'This permanently deletes the product and cannot be undone. If you want to hide it from the storefront without losing it, archive it instead.',
'blocked' => 'This product has appeared on past orders and cannot be deleted — archive it instead so historical orders keep their reference.',
'disabled_tooltip' => 'Products with order history can\'t be deleted. Archive instead.',
],
],
'form' => [
'name' => [
Expand All @@ -74,6 +78,10 @@
'label' => 'Чернова',
'description' => 'Този продукт ще бъде скрит във всички канали и клиентски групи.',
],
'archived' => [
'label' => 'Archived',
'description' => 'This product is retired but still referenced by historical orders. Move back to Draft to revive it.',
],
],
],
'tags' => [
Expand Down
8 changes: 8 additions & 0 deletions packages/admin/resources/lang/de/channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@
'label' => 'Standard',
],
],
'actions' => [
'delete' => [
'confirm' => 'This permanently deletes the channel and cannot be undone. If you want to stop using it without losing it, mark it Inactive instead.',
'blocked' => 'This channel has orders associated with it and cannot be deleted — mark it Inactive instead so historical orders keep their context.',
'disabled_tooltip' => 'Channels with order history can\'t be deleted. Mark Inactive instead.',
],
],

];
4 changes: 2 additions & 2 deletions packages/admin/resources/lang/de/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
'label' => 'Referenz',
],
'status' => [
'label' => 'Status',
'label' => 'Order',
],
'transaction' => [
'label' => 'Transaktion',
Expand Down Expand Up @@ -165,7 +165,7 @@
'message' => 'Zum Zeitpunkt der Bestellung: :count',
],
'status' => [
'label' => 'Status',
'label' => 'Order',
],
'reference' => [
'label' => 'Referenz',
Expand Down
14 changes: 11 additions & 3 deletions packages/admin/resources/lang/de/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
'all' => 'All',
'published' => 'Published',
'draft' => 'Draft',
'archived' => 'Archived',
],
'status' => [
'unpublished' => [
'content' => 'Derzeit im Entwurfsstatus, dieses Produkt ist in allen Kanälen und Kundengruppen nicht verfügbar.',
],
'availability' => [
'customer_groups' => 'Dieses Produkt ist derzeit für alle Kundengruppen nicht verfügbar.',
'channels' => 'Dieses Produkt ist derzeit für alle Kanäle nicht verfügbar.',
Expand Down Expand Up @@ -47,8 +45,14 @@
'actions' => [
'edit_status' => [
'label' => 'Status aktualisieren',
'label_with_state' => 'Status: :state',
'heading' => 'Status aktualisieren',
],
'delete' => [
'confirm' => 'This permanently deletes the product and cannot be undone. If you want to hide it from the storefront without losing it, archive it instead.',
'blocked' => 'This product has appeared on past orders and cannot be deleted — archive it instead so historical orders keep their reference.',
'disabled_tooltip' => 'Products with order history can\'t be deleted. Archive instead.',
],
],
'form' => [
'name' => [
Expand All @@ -74,6 +78,10 @@
'label' => 'Entwurf',
'description' => 'Dieses Produkt wird in allen Kanälen und Kundengruppen verborgen sein',
],
'archived' => [
'label' => 'Archived',
'description' => 'This product is retired but still referenced by historical orders. Move back to Draft to revive it.',
],
],
],
'tags' => [
Expand Down
8 changes: 8 additions & 0 deletions packages/admin/resources/lang/en/channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@
],
],

'actions' => [
'delete' => [
'confirm' => 'This permanently deletes the channel and cannot be undone. If you want to stop using it without losing it, mark it Inactive instead.',
'blocked' => 'This channel has orders associated with it and cannot be deleted — mark it Inactive instead so historical orders keep their context.',
'disabled_tooltip' => 'Channels with order history can\'t be deleted. Mark Inactive instead.',
],
],

];
4 changes: 2 additions & 2 deletions packages/admin/resources/lang/en/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
'label' => 'Reference',
],
'status' => [
'label' => 'Status',
'label' => 'Order',
],
'transaction' => [
'label' => 'Transaction',
Expand Down Expand Up @@ -178,7 +178,7 @@
'message' => 'at time of ordering: :count',
],
'status' => [
'label' => 'Status',
'label' => 'Order',
],
'reference' => [
'label' => 'Reference',
Expand Down
14 changes: 11 additions & 3 deletions packages/admin/resources/lang/en/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
'all' => 'All',
'published' => 'Published',
'draft' => 'Draft',
'archived' => 'Archived',
],

'status' => [
'unpublished' => [
'content' => 'Currently in draft status, this product is unavailable across all channels and customer groups.',
],
'availability' => [
'customer_groups' => 'This product is currently unavailable for all customer groups.',
'channels' => 'This product is currently unavailable for all channels.',
Expand Down Expand Up @@ -53,8 +51,14 @@
'actions' => [
'edit_status' => [
'label' => 'Update Status',
'label_with_state' => 'Status: :state',
'heading' => 'Update Status',
],
'delete' => [
'confirm' => 'This permanently deletes the product and cannot be undone. If you want to hide it from the storefront without losing it, archive it instead.',
'blocked' => 'This product has appeared on past orders and cannot be deleted — archive it instead so historical orders keep their reference.',
'disabled_tooltip' => 'Products with order history can\'t be deleted. Archive instead.',
],
],

'form' => [
Expand All @@ -81,6 +85,10 @@
'label' => 'Draft',
'description' => 'This product will be hidden across all channels and customer groups',
],
'archived' => [
'label' => 'Archived',
'description' => 'This product is retired but still referenced by historical orders. Move back to Draft to revive it.',
],
],
],
'tags' => [
Expand Down
8 changes: 8 additions & 0 deletions packages/admin/resources/lang/es/channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@
'label' => 'Predeterminado',
],
],
'actions' => [
'delete' => [
'confirm' => 'This permanently deletes the channel and cannot be undone. If you want to stop using it without losing it, mark it Inactive instead.',
'blocked' => 'This channel has orders associated with it and cannot be deleted — mark it Inactive instead so historical orders keep their context.',
'disabled_tooltip' => 'Channels with order history can\'t be deleted. Mark Inactive instead.',
],
],

];
4 changes: 2 additions & 2 deletions packages/admin/resources/lang/es/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
'label' => 'Referencia',
],
'status' => [
'label' => 'Estado',
'label' => 'Order',
],
'transaction' => [
'label' => 'Transacción',
Expand Down Expand Up @@ -165,7 +165,7 @@
'message' => 'al momento de hacer el pedido: :count',
],
'status' => [
'label' => 'Estado',
'label' => 'Order',
],
'reference' => [
'label' => 'Referencia',
Expand Down
Loading