File tree Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace CloudCreativity \LaravelJsonApi ;
4
+
5
+ class LaravelJsonApi
6
+ {
7
+
8
+ /**
9
+ * Indicates if Laravel JSON API migrations will be run.
10
+ *
11
+ * @var bool
12
+ */
13
+ public static $ runMigrations = true ;
14
+
15
+ /**
16
+ * Indicates if listeners will be bound to the Laravel queue events.
17
+ *
18
+ * @var bool
19
+ */
20
+ public static $ queueBindings = true ;
21
+
22
+ /**
23
+ * @return LaravelJsonApi
24
+ */
25
+ public static function ignoreMigrations (): self
26
+ {
27
+ static ::$ runMigrations = false ;
28
+
29
+ return new self ();
30
+ }
31
+
32
+ /**
33
+ * @return LaravelJsonApi
34
+ */
35
+ public static function skipQueueBindings (): self
36
+ {
37
+ static ::$ queueBindings = false ;
38
+
39
+ return new self ();
40
+ }
41
+ }
Original file line number Diff line number Diff line change @@ -69,8 +69,10 @@ public function boot(Router $router)
69
69
$ this ->bootBladeDirectives ();
70
70
$ this ->bootTranslations ();
71
71
72
- Queue::after (UpdateClientProcess::class);
73
- Queue::failing (UpdateClientProcess::class);
72
+ if (LaravelJsonApi::$ queueBindings ) {
73
+ Queue::after (UpdateClientProcess::class);
74
+ Queue::failing (UpdateClientProcess::class);
75
+ }
74
76
75
77
if ($ this ->app ->runningInConsole ()) {
76
78
$ this ->bootMigrations ();
@@ -159,7 +161,9 @@ protected function bootBladeDirectives()
159
161
*/
160
162
protected function bootMigrations ()
161
163
{
162
- $ this ->loadMigrationsFrom (__DIR__ . '/../database/migrations ' );
164
+ if (LaravelJsonApi::$ runMigrations ) {
165
+ $ this ->loadMigrationsFrom (__DIR__ . '/../database/migrations ' );
166
+ }
163
167
}
164
168
165
169
/**
You can’t perform that action at this time.
0 commit comments