Skip to content

Commit 21bb042

Browse files
authored
Update DumpCommand.php (#57735)
1 parent 5af3055 commit 21bb042

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Illuminate/Database/Console/DumpCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Illuminate\Database\Console;
44

55
use Illuminate\Console\Command;
6+
use Illuminate\Console\Prohibitable;
67
use Illuminate\Contracts\Events\Dispatcher;
78
use Illuminate\Database\Connection;
89
use Illuminate\Database\ConnectionResolverInterface;
@@ -15,6 +16,8 @@
1516
#[AsCommand(name: 'schema:dump')]
1617
class DumpCommand extends Command
1718
{
19+
use Prohibitable;
20+
1821
/**
1922
* The console command name.
2023
*
@@ -41,6 +44,10 @@ class DumpCommand extends Command
4144
*/
4245
public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher)
4346
{
47+
if ($this->isProhibited()) {
48+
return Command::FAILURE;
49+
}
50+
4451
$connection = $connections->connection($database = $this->input->getOption('database'));
4552

4653
$this->schemaState($connection)->dump(

0 commit comments

Comments
 (0)