File tree Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 7
7
use Illuminate \Support \ServiceProvider ;
8
8
use Studio \Totem \Events \Executed ;
9
9
use Studio \Totem \Events \Executing ;
10
+ use Studio \Totem \Totem ;
10
11
11
12
class ConsoleServiceProvider extends ServiceProvider
12
13
{
@@ -17,9 +18,11 @@ class ConsoleServiceProvider extends ServiceProvider
17
18
*/
18
19
public function boot ()
19
20
{
20
- $ this ->app ->resolving (Schedule::class, function ($ schedule ) {
21
- $ this ->schedule ($ schedule );
22
- });
21
+ if (Totem::baseTableExists ()) {
22
+ $ this ->app ->resolving (Schedule::class, function ($ schedule ) {
23
+ $ this ->schedule ($ schedule );
24
+ });
25
+ }
23
26
}
24
27
25
28
/**
Original file line number Diff line number Diff line change 4
4
5
5
use Cron \CronExpression ;
6
6
use Illuminate \Http \UploadedFile ;
7
- use Illuminate \Support \Facades \Log ;
8
7
use Illuminate \Support \Facades \Schema ;
9
8
use Illuminate \Support \Facades \Validator ;
10
9
use Illuminate \Support \ServiceProvider ;
11
10
use Studio \Totem \Console \Commands \ListSchedule ;
12
11
use Studio \Totem \Console \Commands \PublishAssets ;
13
12
use Studio \Totem \Contracts \TaskInterface ;
14
13
use Studio \Totem \Repositories \EloquentTaskRepository ;
15
- use Studio \Totem \Totem ;
16
14
17
15
class TotemServiceProvider extends ServiceProvider
18
16
{
@@ -23,14 +21,6 @@ class TotemServiceProvider extends ServiceProvider
23
21
*/
24
22
public function boot ()
25
23
{
26
- try {
27
- if (Totem::baseTableExists ()) {
28
- $ this ->app ->register (ConsoleServiceProvider::class);
29
- }
30
- } catch (\PDOException $ ex ) {
31
- // This will trigger if DB cannot be connected to
32
- Log::error ($ ex ->getMessage ());
33
- }
34
24
$ this ->registerResources ();
35
25
$ this ->defineAssetPublishing ();
36
26
@@ -77,6 +67,7 @@ public function register()
77
67
$ this ->app ->register (TotemRouteServiceProvider::class);
78
68
$ this ->app ->register (TotemEventServiceProvider::class);
79
69
$ this ->app ->register (TotemFormServiceProvider::class);
70
+ $ this ->app ->register (ConsoleServiceProvider::class);
80
71
}
81
72
82
73
/**
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ public function auth_middleware_works()
32
32
$ middleware = new Authenticate ;
33
33
34
34
$ response = $ middleware ->handle (
35
- new class {
35
+ new class
36
+ {
36
37
},
37
38
function ($ value ) {
38
39
return 'response ' ;
@@ -55,7 +56,8 @@ public function auth_middleware_responds_with_403_on_failure()
55
56
$ middleware = new Authenticate ;
56
57
57
58
$ response = $ middleware ->handle (
58
- new class {
59
+ new class
60
+ {
59
61
},
60
62
function ($ value ) {
61
63
return 'response ' ;
Original file line number Diff line number Diff line change @@ -74,7 +74,8 @@ protected function getPackageProviders($app)
74
74
*/
75
75
protected function disableExceptionHandling ()
76
76
{
77
- $ this ->app ->instance (ExceptionHandler::class, new class () extends Handler {
77
+ $ this ->app ->instance (ExceptionHandler::class, new class () extends Handler
78
+ {
78
79
public function __construct ()
79
80
{
80
81
}
You can’t perform that action at this time.
0 commit comments