PHP code example of binarybuilds / filament-command-runner
1. Go to this page and download the library: Download binarybuilds/filament-command-runner library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
binarybuilds / filament-command-runner example snippets
use Illuminate\Support\Str;
$panel->plugin(
CommandRunnerPlugin::make()->validateCommand(function (string $attribute, string $value, \Closure $fail) {
if (!Str::startsWith($value, 'php artisan')) {
$fail("You can only run artisan commands");
}
})
);