mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-08 05:58:37 +02:00
replace array_first
with Arr:first
This commit is contained in:
parent
25e45883a8
commit
a32309ea2c
@ -20,6 +20,7 @@ use Filament\Notifications\Notification;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class Startup extends ServerFormPage
|
||||
@ -168,7 +169,7 @@ class Startup extends ServerFormPage
|
||||
|
||||
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) {
|
||||
return !$containsRuleIn;
|
||||
@ -186,7 +187,7 @@ class Startup extends ServerFormPage
|
||||
*/
|
||||
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)
|
||||
->after('in:')
|
||||
|
Loading…
x
Reference in New Issue
Block a user