File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,16 @@ public function __construct($data)
22
22
{
23
23
$ this ->update ($ data );
24
24
25
- $ this ->mergeWithJson (base_path ("hooks/ {$ this ->name }/hook.json " ));
25
+ $ this ->loadJson ();
26
+ }
27
+
28
+ public function loadJson ($ path = null )
29
+ {
30
+ if (is_null ($ path )) {
31
+ $ path = base_path ("hooks/ {$ this ->name }/hook.json " );
32
+ }
33
+
34
+ $ this ->mergeWithJson ($ path );
26
35
}
27
36
28
37
public function update (array $ parameters )
Original file line number Diff line number Diff line change @@ -129,6 +129,8 @@ public function uninstall($name, $keep = false)
129
129
130
130
$ hook = $ this ->hook ($ name );
131
131
132
+ $ hook ->loadJson ();
133
+
132
134
event (new Events \UninstallingHook ($ hook ));
133
135
134
136
if ($ this ->enabled ($ name )) {
@@ -182,6 +184,8 @@ public function update($name, $version = null)
182
184
183
185
$ hook = $ this ->hook ($ name );
184
186
187
+ $ hook ->loadJson ();
188
+
185
189
if ($ version == $ hook ->version ) {
186
190
return false ;
187
191
}
@@ -234,6 +238,8 @@ public function enable($name)
234
238
235
239
$ hook = $ this ->hook ($ name );
236
240
241
+ $ hook ->loadJson ();
242
+
237
243
event (new Events \EnablingHook ($ hook ));
238
244
239
245
$ this ->runScripts ($ name , 'enable ' );
@@ -270,6 +276,8 @@ public function disable($name)
270
276
271
277
$ hook = $ this ->hook ($ name );
272
278
279
+ $ hook ->loadJson ();
280
+
273
281
event (new Events \DisablingHook ($ hook ));
274
282
275
283
$ this ->runScripts ($ name , 'disable ' );
@@ -517,6 +525,7 @@ public function runScripts($name, $events)
517
525
}
518
526
519
527
$ hook = $ this ->hook ($ name );
528
+ $ hook ->loadJson ();
520
529
521
530
foreach ($ events as $ event ) {
522
531
foreach ($ hook ->scripts ($ event ) as $ script ) {
You can’t perform that action at this time.
0 commit comments