@@ 67-92 (lines=26) @@ | ||
64 | * |
|
65 | * @return mixed |
|
66 | */ |
|
67 | public function fire() |
|
68 | { |
|
69 | if (!$this->confirmToProceed()) { |
|
70 | return; |
|
71 | } |
|
72 | ||
73 | $slug = $this->argument('slug'); |
|
74 | ||
75 | if (!empty($slug)) { |
|
76 | if ($this->module->isEnabled($slug)) { |
|
77 | return $this->reset($slug); |
|
78 | } elseif ($this->option('force')) { |
|
79 | return $this->reset($slug); |
|
80 | } |
|
81 | } else { |
|
82 | if ($this->option('force')) { |
|
83 | $modules = $this->module->all()->reverse(); |
|
84 | } else { |
|
85 | $modules = $this->module->enabled()->reverse(); |
|
86 | } |
|
87 | ||
88 | foreach ($modules as $module) { |
|
89 | $this->reset($module['slug']); |
|
90 | } |
|
91 | } |
|
92 | } |
|
93 | ||
94 | /** |
|
95 | * Run the migration reset for the specified module. |
@@ 48-75 (lines=28) @@ | ||
45 | * |
|
46 | * @return mixed |
|
47 | */ |
|
48 | public function fire() |
|
49 | { |
|
50 | $slug = $this->argument('slug'); |
|
51 | ||
52 | if (isset($slug)) { |
|
53 | if (!$this->module->exists($slug)) { |
|
54 | return $this->error('Module does not exist.'); |
|
55 | } |
|
56 | ||
57 | if ($this->module->isEnabled($slug)) { |
|
58 | $this->seed($slug); |
|
59 | } elseif ($this->option('force')) { |
|
60 | $this->seed($slug); |
|
61 | } |
|
62 | ||
63 | return; |
|
64 | } else { |
|
65 | if ($this->option('force')) { |
|
66 | $modules = $this->module->all(); |
|
67 | } else { |
|
68 | $modules = $this->module->enabled(); |
|
69 | } |
|
70 | ||
71 | foreach ($modules as $module) { |
|
72 | $this->seed($module['slug']); |
|
73 | } |
|
74 | } |
|
75 | } |
|
76 | ||
77 | /** |
|
78 | * Seed the specific module. |