diff --git a/docs/core/local-development.md b/docs/core/local-development.md index f3cf643e91..c5ec42339e 100644 --- a/docs/core/local-development.md +++ b/docs/core/local-development.md @@ -45,6 +45,11 @@ Update your `composer.json` file similar to the following. } ```` +Ensure minimum stability is set for development +```json + "minimum-stability": "dev", +```` + Run `composer update` from your Laravel application's root directory and fingers crossed you're all up and running,. ```sh diff --git a/docs/core/reference/products.md b/docs/core/reference/products.md index 252ce776e2..94e663f2cb 100644 --- a/docs/core/reference/products.md +++ b/docs/core/reference/products.md @@ -35,13 +35,13 @@ group, or you can state which dates they should be active for (as long as the cu ```php // Will schedule for this product to be enabled in 14 days for this customer group. -$product->schedule($customerGroup, now()->addDays(14)); +$product->scheduleCustomerGroup($customerGroup, now()->addDays(14)); // Schedule the product to be enabled straight away -$product->schedule($customerGroup); +$product->scheduleCustomerGroup($customerGroup); // The schedule method will accept an array or collection of customer groups. -$product->schedule(CustomerGroup::get()); +$product->scheduleCustomerGroup(CustomerGroup::get()); ``` ### Retrieving products for a customer group diff --git a/packages/admin/src/Filament/Resources/CollectionGroupResource.php b/packages/admin/src/Filament/Resources/CollectionGroupResource.php index d96f76427d..d506b2184c 100644 --- a/packages/admin/src/Filament/Resources/CollectionGroupResource.php +++ b/packages/admin/src/Filament/Resources/CollectionGroupResource.php @@ -21,8 +21,6 @@ class CollectionGroupResource extends BaseResource protected static ?int $navigationSort = 3; - protected static ?string $navigationLabel = 'Collections'; - public static function getLabel(): string { return __('lunarpanel::collectiongroup.label'); diff --git a/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductInventory.php b/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductInventory.php index 900356b578..da6d6ef1ff 100644 --- a/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductInventory.php +++ b/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductInventory.php @@ -92,7 +92,7 @@ protected function getFormActions(): array ]; } - public function form(Form $form): Form + public function getDefaultForm(Form $form): Form { return (new ManageVariantInventory)->form($form)->statePath(''); } diff --git a/packages/admin/src/Filament/Resources/ProductVariantResource/Pages/ManageVariantInventory.php b/packages/admin/src/Filament/Resources/ProductVariantResource/Pages/ManageVariantInventory.php index 3dec22cadd..72aac2712d 100644 --- a/packages/admin/src/Filament/Resources/ProductVariantResource/Pages/ManageVariantInventory.php +++ b/packages/admin/src/Filament/Resources/ProductVariantResource/Pages/ManageVariantInventory.php @@ -61,7 +61,7 @@ protected function getDefaultHeaderActions(): array ]; } - public function form(Form $form): Form + public function getDefaultForm(Form $form): Form { return $form->schema([ Section::make()->schema([ diff --git a/packages/admin/src/Support/Pages/BaseCreateRecord.php b/packages/admin/src/Support/Pages/BaseCreateRecord.php index 4a0b803d8e..0c5e414618 100644 --- a/packages/admin/src/Support/Pages/BaseCreateRecord.php +++ b/packages/admin/src/Support/Pages/BaseCreateRecord.php @@ -9,6 +9,7 @@ abstract class BaseCreateRecord extends CreateRecord { use Concerns\ExtendsFooterWidgets; use Concerns\ExtendsFormActions; + use Concerns\ExtendsForms; use Concerns\ExtendsHeaderActions; use Concerns\ExtendsHeaderWidgets; use Concerns\ExtendsHeadings; diff --git a/packages/admin/src/Support/Pages/BaseEditRecord.php b/packages/admin/src/Support/Pages/BaseEditRecord.php index f63f3de97c..4e43fbed8a 100644 --- a/packages/admin/src/Support/Pages/BaseEditRecord.php +++ b/packages/admin/src/Support/Pages/BaseEditRecord.php @@ -9,6 +9,7 @@ abstract class BaseEditRecord extends EditRecord { use Concerns\ExtendsFooterWidgets; use Concerns\ExtendsFormActions; + use Concerns\ExtendsForms; use Concerns\ExtendsHeaderActions; use Concerns\ExtendsHeaderWidgets; use Concerns\ExtendsHeadings; diff --git a/packages/admin/src/Support/Pages/Concerns/ExtendsForms.php b/packages/admin/src/Support/Pages/Concerns/ExtendsForms.php new file mode 100644 index 0000000000..d699471537 --- /dev/null +++ b/packages/admin/src/Support/Pages/Concerns/ExtendsForms.php @@ -0,0 +1,18 @@ +getDefaultForm($form)); + } + + public function getDefaultForm(Form $form): Form + { + return $form; + } +} diff --git a/packages/core/src/FieldTypes/Toggle.php b/packages/core/src/FieldTypes/Toggle.php index a229b16071..9949210133 100644 --- a/packages/core/src/FieldTypes/Toggle.php +++ b/packages/core/src/FieldTypes/Toggle.php @@ -26,7 +26,7 @@ public function jsonSerialize(): mixed /** * Create a new instance of Toggle field type. * - * @param string $value + * @param bool|string $value */ public function __construct($value = false) { diff --git a/tests/core/Unit/FieldTypes/ToggleFieldTest.php b/tests/core/Unit/FieldTypes/ToggleFieldTest.php new file mode 100644 index 0000000000..629196cc25 --- /dev/null +++ b/tests/core/Unit/FieldTypes/ToggleFieldTest.php @@ -0,0 +1,24 @@ +setValue(false); + + expect($field->getValue())->toEqual(false); +}); + +test('can set value in constructor', function () { + $field = new Toggle(true); + + expect($field->getValue())->toEqual(true); +}); + +test('check it does not allow array', function () { + $this->expectException(FieldTypeException::class); + + new Toggle(['foo']); +});