Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace PowerComponents\LivewirePowerGrid\Actions; use function Laravel\Prompts\..
Decoded Output download
<?php
namespace PowerComponents\LivewirePowerGrid\Actions;
use function Laravel\Prompts\select;
use PowerComponents\LivewirePowerGrid\Enums\Datasource;
final class AskComponentDatasource
{
public static function handle(): string
{
// Must pass options as array<int, "label"> to
// improve users experienc when Laravel prompt falls back.
$datasources = Datasource::asOptions();
$choice = strval(select(
label: 'Select your preferred Data source:',
options: $datasources->values()->toArray(), // @phpstan-ignore-line
default: 0
));
// Find and return they key based on user's choice.
return (string) $datasources->filter(function ($item) use ($choice) {
return $item === $choice;
})->keys()[0];
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace PowerComponents\LivewirePowerGrid\Actions;
use function Laravel\Prompts\select;
use PowerComponents\LivewirePowerGrid\Enums\Datasource;
final class AskComponentDatasource
{
public static function handle(): string
{
// Must pass options as array<int, "label"> to
// improve users experienc when Laravel prompt falls back.
$datasources = Datasource::asOptions();
$choice = strval(select(
label: 'Select your preferred Data source:',
options: $datasources->values()->toArray(), // @phpstan-ignore-line
default: 0
));
// Find and return they key based on user's choice.
return (string) $datasources->filter(function ($item) use ($choice) {
return $item === $choice;
})->keys()[0];
}
}
Function Calls
None |
Stats
MD5 | 4c1f8f1a7df1f6cc75a77f96c3036835 |
Eval Count | 0 |
Decode Time | 90 ms |