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 77use Illuminate \Support \ServiceProvider ;
88use Studio \Totem \Events \Executed ;
99use Studio \Totem \Events \Executing ;
10+ use Studio \Totem \Totem ;
1011
1112class ConsoleServiceProvider extends ServiceProvider
1213{
@@ -17,9 +18,11 @@ class ConsoleServiceProvider extends ServiceProvider
1718 */
1819 public function boot ()
1920 {
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+ }
2326 }
2427
2528 /**
Original file line number Diff line number Diff line change 44
55use Cron \CronExpression ;
66use Illuminate \Http \UploadedFile ;
7- use Illuminate \Support \Facades \Log ;
87use Illuminate \Support \Facades \Schema ;
98use Illuminate \Support \Facades \Validator ;
109use Illuminate \Support \ServiceProvider ;
1110use Studio \Totem \Console \Commands \ListSchedule ;
1211use Studio \Totem \Console \Commands \PublishAssets ;
1312use Studio \Totem \Contracts \TaskInterface ;
1413use Studio \Totem \Repositories \EloquentTaskRepository ;
15- use Studio \Totem \Totem ;
1614
1715class TotemServiceProvider extends ServiceProvider
1816{
@@ -23,14 +21,6 @@ class TotemServiceProvider extends ServiceProvider
2321 */
2422 public function boot ()
2523 {
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- }
3424 $ this ->registerResources ();
3525 $ this ->defineAssetPublishing ();
3626
@@ -77,6 +67,7 @@ public function register()
7767 $ this ->app ->register (TotemRouteServiceProvider::class);
7868 $ this ->app ->register (TotemEventServiceProvider::class);
7969 $ this ->app ->register (TotemFormServiceProvider::class);
70+ $ this ->app ->register (ConsoleServiceProvider::class);
8071 }
8172
8273 /**
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ public function auth_middleware_works()
3232 $ middleware = new Authenticate ;
3333
3434 $ response = $ middleware ->handle (
35- new class {
35+ new class
36+ {
3637 },
3738 function ($ value ) {
3839 return 'response ' ;
@@ -55,7 +56,8 @@ public function auth_middleware_responds_with_403_on_failure()
5556 $ middleware = new Authenticate ;
5657
5758 $ response = $ middleware ->handle (
58- new class {
59+ new class
60+ {
5961 },
6062 function ($ value ) {
6163 return 'response ' ;
Original file line number Diff line number Diff line change @@ -74,7 +74,8 @@ protected function getPackageProviders($app)
7474 */
7575 protected function disableExceptionHandling ()
7676 {
77- $ this ->app ->instance (ExceptionHandler::class, new class () extends Handler {
77+ $ this ->app ->instance (ExceptionHandler::class, new class () extends Handler
78+ {
7879 public function __construct ()
7980 {
8081 }
You can’t perform that action at this time.
0 commit comments