|
3 | 3 | namespace Nwidart\Modules\Facades; |
4 | 4 |
|
5 | 5 | use Illuminate\Support\Facades\Facade; |
| 6 | +use Nwidart\Modules\Commands\Database\MigrateFreshCommand; |
| 7 | +use Nwidart\Modules\Commands\Database\MigrateRefreshCommand; |
| 8 | +use Nwidart\Modules\Commands\Database\MigrateResetCommand; |
6 | 9 |
|
7 | 10 | /** |
8 | 11 | * @method static array all() |
|
19 | 22 | * @method static \Nwidart\Modules\Module findOrFail(string $name) |
20 | 23 | * @method static string getModulePath($moduleName) |
21 | 24 | * @method static \Illuminate\Filesystem\Filesystem getFiles() |
22 | | - * @method static mixed config(string $key, $default = NULL) |
| 25 | + * @method static mixed config(string $key, $default = null) |
23 | 26 | * @method static string getPath() |
24 | 27 | * @method static void boot() |
25 | 28 | * @method static void register(): void |
|
30 | 33 | */ |
31 | 34 | class Module extends Facade |
32 | 35 | { |
| 36 | + /** |
| 37 | + * Indicate if destructive Artisan commands should be prohibited. |
| 38 | + * |
| 39 | + * Prohibits: module:migrate-fresh, module:migrate-refresh, and module:migrate-reset |
| 40 | + * |
| 41 | + * @param bool $prohibit |
| 42 | + * @return void |
| 43 | + */ |
| 44 | + public static function prohibitDestructiveCommands(bool $prohibit = true): void |
| 45 | + { |
| 46 | + MigrateFreshCommand::prohibit($prohibit); |
| 47 | + MigrateRefreshCommand::prohibit($prohibit); |
| 48 | + MigrateResetCommand::prohibit($prohibit); |
| 49 | + } |
| 50 | + |
33 | 51 | protected static function getFacadeAccessor(): string |
34 | 52 | { |
35 | 53 | return 'modules'; |
|
0 commit comments