replace array_first with Arr:first

This commit is contained in:
Boy132 2025-09-02 09:28:48 +02:00
parent 25e45883a8
commit a32309ea2c

View File

@ -20,6 +20,7 @@ use Filament\Notifications\Notification;
use Filament\Schemas\Components\Section; use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
class Startup extends ServerFormPage class Startup extends ServerFormPage
@ -168,7 +169,7 @@ class Startup extends ServerFormPage
private function shouldHideComponent(ServerVariable $serverVariable, Component $component): bool private function shouldHideComponent(ServerVariable $serverVariable, Component $component): bool
{ {
$containsRuleIn = array_first($serverVariable->variable->rules, fn ($value) => str($value)->startsWith('in:'), false); $containsRuleIn = Arr::first($serverVariable->variable->rules, fn ($value) => str($value)->startsWith('in:'), false);
if ($component instanceof Select) { if ($component instanceof Select) {
return !$containsRuleIn; return !$containsRuleIn;
@ -186,7 +187,7 @@ class Startup extends ServerFormPage
*/ */
private function getSelectOptionsFromRules(ServerVariable $serverVariable): array private function getSelectOptionsFromRules(ServerVariable $serverVariable): array
{ {
$inRule = array_first($serverVariable->variable->rules, fn ($value) => str($value)->startsWith('in:')); $inRule = Arr::first($serverVariable->variable->rules, fn ($value) => str($value)->startsWith('in:'));
return str($inRule) return str($inRule)
->after('in:') ->after('in:')