Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Notification make command markdown name placeholder from Notif… #52465

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Create Notification make command markdown name placeholder from Notif…
…ication name
  • Loading branch information
hosseinakbari-liefermia committed Aug 13, 2024
commit 63d828de2d1b9bf228a9d452deab2fcf98fac4d9
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@

use Illuminate\Console\Concerns\CreatesMatchingTest;
use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -143,7 +144,10 @@ protected function afterPromptingForMissingArguments(InputInterface $input, Outp
$wantsMarkdownView = confirm('Would you like to create a markdown view?');

if ($wantsMarkdownView) {
$markdownView = text('What should the markdown view be named?', 'E.g. invoice-paid');
$defaultMarkdownView = collect(explode('/', str_replace('\\', '/', $this->argument('name'))))
->map(fn($path) => Str::kebab($path))
->implode('/');
$markdownView = text('What should the markdown view be named?', "E.g. {$defaultMarkdownView}");
$input->setOption('markdown', $markdownView);
}
}