Skip to content

Commit

Permalink
Use slugify to determine block filename
Browse files Browse the repository at this point in the history
  • Loading branch information
robdekort committed Nov 3, 2021
1 parent 0bed527 commit 5849326
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dev/app/Console/Commands/AddBlock.php
Expand Up @@ -6,7 +6,9 @@
use Illuminate\Support\Str;
use Illuminate\Support\Facades\File;
use Statamic\Console\RunsInPlease;
use Statamic\Facades\Config;
use Statamic\Support\Arr;
use Stringy\StaticStringy as Stringy;
use Symfony\Component\Yaml\Yaml;

class AddBlock extends Command
Expand Down Expand Up @@ -56,7 +58,7 @@ class AddBlock extends Command
public function handle()
{
$this->block_name = $this->ask('What should be the name for this block?');
$this->filename = $this->ask('What should be the filename for this block?');
$this->filename = Stringy::slugify($this->block_name, '_', Config::getShortLocale());
$this->instructions = $this->ask('What should be the instructions for this block?');

try {
Expand Down

0 comments on commit 5849326

Please sign in to comment.