From dc87e21fbc777e3f48ec02eefe23ab5deb876772 Mon Sep 17 00:00:00 2001 From: Zacharias Creutznacher Date: Thu, 19 Oct 2023 16:16:53 +0200 Subject: [PATCH] output info text only in cli mode --- src/Commands/GenerateRulesCommand.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Commands/GenerateRulesCommand.php b/src/Commands/GenerateRulesCommand.php index f5f9339..1e78789 100644 --- a/src/Commands/GenerateRulesCommand.php +++ b/src/Commands/GenerateRulesCommand.php @@ -102,8 +102,11 @@ private function checkTableAndColumns(string $table, array $columns = []): void private function createOutput(string $table, array $rules): void { - $this->info("Schema-based validation rules for table \"$table\" have been generated!"); - $this->info('Copy & paste these to your controller validation or form request or where ever your validation takes place:'); + if (app()->runningInConsole()) { + $this->info("Schema-based validation rules for table \"$table\" have been generated!"); + $this->info('Copy & paste these to your controller validation or form request or where ever your validation takes place:'); + } + $this->line($this->format($rules)); }