Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Implemented new Laravel prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-ro committed Aug 7, 2023
1 parent fcca716 commit e3b832b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Commands/MakePageBlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@

namespace MartinRo\FilamentPageBlocks\Commands;

use Filament\Support\Commands\Concerns\CanIndentStrings;
use Filament\Support\Commands\Concerns\CanManipulateFiles;
use Filament\Support\Commands\Concerns\CanValidateInput;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
use function Laravel\Prompts\text;

class MakePageBlockCommand extends Command
{
use CanIndentStrings;
use CanManipulateFiles;
use CanValidateInput;

protected $signature = 'make:filament-page-block {name?} {--F|force}';

protected $description = 'Create a new filament page block';

public function handle(): int
{
$pageBlock = (string) Str::of($this->argument('name') ?? $this->askRequired('Name (e.g. `HeroBlock`)', 'name'))
// $pageBlock = (string) Str::of($this->argument('name') ?? $this->askRequired('Name (e.g. `HeroBlock`)', 'name'))
// ->trim('/')
// ->trim('\\')
// ->trim(' ')
// ->replace('/', '\\');

$pageBlock = (string) Str::of($this->argument('name') ?? text(label: 'Name (e.g. `HeroBlock`)', required: true))
->trim('/')
->trim('\\')
->trim(' ')
Expand Down

0 comments on commit e3b832b

Please sign in to comment.