From 52a976154cd1b11b3fbda1cdbc1d84b48ec760e6 Mon Sep 17 00:00:00 2001 From: David Ringle Date: Tue, 22 Apr 2025 17:35:01 +0300 Subject: [PATCH 1/2] Fix method annotations and update facade accessor in Selectable --- ide-helper/Collection.php | 2 +- src/Facades/Selectable.php | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ide-helper/Collection.php b/ide-helper/Collection.php index bba7bb4..930d285 100644 --- a/ide-helper/Collection.php +++ b/ide-helper/Collection.php @@ -2,7 +2,7 @@ namespace Illuminate\Support { /** - * @method \Ringlesoft\LaravelSelectable\Facades\Selectable toSelectable() + * @method \Ringlesoft\LaravelSelectable\Selectable toSelectable() * @mehtbod string toSelectOptions(string|callable $label = null, string|callable $value = null, mixed $selected = null, mixed $disabled = null) */ class Collection diff --git a/src/Facades/Selectable.php b/src/Facades/Selectable.php index 8dd46a7..1baa064 100644 --- a/src/Facades/Selectable.php +++ b/src/Facades/Selectable.php @@ -2,13 +2,28 @@ namespace Ringlesoft\LaravelSelectable\Facades; +use Closure; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Facade; -use RingleSoft\LaravelSelectable\LaravelSelectableServiceProvider; +/** + * @method static self fromCollection(Collection $collection) + * @method static string collectionToSelectOptions(Collection $collection, string|Closure|null $label = null, string|Closure|null $value = null, mixed $selected = null, mixed $disabled = null) + * @method static Collection toCollection() + * @method static string toSelectOptions() + * @method static Collection toSelectItems() + * @method static self withLabel(string|Closure $label) + * @method static self withValue(string|Closure $value) + * @method static self withSelected(mixed $selected) + * @method static self withDisabled(mixed $disabled) + * @method static self withDataAttribute(string|Closure $attribute, string|Closure $value) + * @method static self withClass(string|array|Closure $class) + * @method static self withId(Closure $id) + */ class Selectable extends Facade { protected static function getFacadeAccessor(): string { - return LaravelSelectableServiceProvider::class; + return \RingleSoft\LaravelSelectable\Selectable::class; } } From 709b831e7fc3dd4e722a13df3aae1ae9bf27ffe2 Mon Sep 17 00:00:00 2001 From: David Ringle Date: Tue, 22 Apr 2025 17:35:32 +0300 Subject: [PATCH 2/2] Bump version to 1.0.5 in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b01d1d9..25e762a 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "name": "master" } }, - "version": "1.0.4", + "version": "1.0.5", "minimum-stability": "dev", "prefer-stable": true }