• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

orchestral / canvas / 6230248667

19 Sep 2023 02:04AM UTC coverage: 90.939% (-0.07%) from 91.005%
6230248667

push

github

crynobone
wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

47 of 47 new or added lines in 5 files covered. (100.0%)

552 of 607 relevant lines covered (90.94%)

28.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.6
/src/LaravelServiceProvider.php
1
<?php
2

3
namespace Orchestra\Canvas;
4

5
use Illuminate\Contracts\Support\DeferrableProvider;
6
use Illuminate\Database\Console\Factories\FactoryMakeCommand;
7
use Illuminate\Database\Console\Migrations\MigrateMakeCommand;
8
use Illuminate\Database\Console\Seeds\SeederMakeCommand;
9
use Illuminate\Foundation\Console\CastMakeCommand;
10
use Illuminate\Foundation\Console\ChannelMakeCommand;
11
use Illuminate\Foundation\Console\ComponentMakeCommand;
12
use Illuminate\Foundation\Console\ConsoleMakeCommand;
13
use Illuminate\Foundation\Console\EventMakeCommand;
14
use Illuminate\Foundation\Console\ExceptionMakeCommand;
15
use Illuminate\Foundation\Console\JobMakeCommand;
16
use Illuminate\Foundation\Console\ListenerMakeCommand;
17
use Illuminate\Foundation\Console\MailMakeCommand;
18
use Illuminate\Foundation\Console\ModelMakeCommand;
19
use Illuminate\Foundation\Console\NotificationMakeCommand;
20
use Illuminate\Foundation\Console\ObserverMakeCommand;
21
use Illuminate\Foundation\Console\PolicyMakeCommand;
22
use Illuminate\Foundation\Console\ProviderMakeCommand;
23
use Illuminate\Foundation\Console\RequestMakeCommand;
24
use Illuminate\Foundation\Console\ResourceMakeCommand;
25
use Illuminate\Foundation\Console\RuleMakeCommand;
26
use Illuminate\Foundation\Console\ScopeMakeCommand;
27
use Illuminate\Foundation\Console\TestMakeCommand;
28
use Illuminate\Notifications\Console\NotificationTableCommand;
29
use Illuminate\Queue\Console\BatchesTableCommand;
30
use Illuminate\Queue\Console\FailedTableCommand;
31
use Illuminate\Queue\Console\TableCommand as QueueTableCommand;
32
use Illuminate\Routing\Console\ControllerMakeCommand;
33
use Illuminate\Routing\Console\MiddlewareMakeCommand;
34
use Illuminate\Session\Console\SessionTableCommand;
35
use Illuminate\Support\ServiceProvider;
36

37
class LaravelServiceProvider extends ServiceProvider implements DeferrableProvider
38
{
39
    /**
40
     * Register the service provider.
41
     *
42
     * @return void
43
     */
44
    public function register()
45
    {
46
        $this->registerCastMakeCommand();
96✔
47
        $this->registerChannelMakeCommand();
96✔
48
        $this->registerComponentMakeCommand();
96✔
49
        $this->registerConsoleMakeCommand();
96✔
50
        $this->registerControllerMakeCommand();
96✔
51
        $this->registerEventMakeCommand();
96✔
52
        $this->registerExceptionMakeCommand();
96✔
53
        $this->registerFactoryMakeCommand();
96✔
54
        $this->registerJobMakeCommand();
96✔
55
        $this->registerListenerMakeCommand();
96✔
56
        $this->registerMailMakeCommand();
96✔
57
        $this->registerMiddlewareMakeCommand();
96✔
58
        $this->registerMigrateMakeCommand();
96✔
59
        $this->registerModelMakeCommand();
96✔
60
        $this->registerNotificationMakeCommand();
96✔
61
        $this->registerObserverMakeCommand();
96✔
62
        $this->registerPolicyMakeCommand();
96✔
63
        $this->registerProviderMakeCommand();
96✔
64
        $this->registerRequestMakeCommand();
96✔
65
        $this->registerResourceMakeCommand();
96✔
66
        $this->registerRuleMakeCommand();
96✔
67
        $this->registerScopeMakeCommand();
96✔
68
        $this->registerSeederMakeCommand();
96✔
69
        $this->registerTestMakeCommand();
96✔
70

71
        $this->registerNotificationTableCommand();
96✔
72
        $this->registerQueueBatchesTableCommand();
96✔
73
        $this->registerQueueFailedTableCommand();
96✔
74
        $this->registerQueueTableCommand();
96✔
75
        $this->registerSessionTableCommand();
96✔
76

77
        $this->commands([
96✔
78
            Console\CastMakeCommand::class,
96✔
79
            Console\ChannelMakeCommand::class,
96✔
80
            Console\ComponentMakeCommand::class,
96✔
81
            Console\ConsoleMakeCommand::class,
96✔
82
            Console\ControllerMakeCommand::class,
96✔
83
            Console\EventMakeCommand::class,
96✔
84
            Console\ExceptionMakeCommand::class,
96✔
85
            Console\FactoryMakeCommand::class,
96✔
86
            Console\JobMakeCommand::class,
96✔
87
            Console\ListenerMakeCommand::class,
96✔
88
            Console\MailMakeCommand::class,
96✔
89
            Console\MiddlewareMakeCommand::class,
96✔
90
            Console\MigrateMakeCommand::class,
96✔
91
            Console\ModelMakeCommand::class,
96✔
92
            Console\NotificationMakeCommand::class,
96✔
93
            Console\ObserverMakeCommand::class,
96✔
94
            Console\PolicyMakeCommand::class,
96✔
95
            Console\ProviderMakeCommand::class,
96✔
96
            Console\RequestMakeCommand::class,
96✔
97
            Console\ResourceMakeCommand::class,
96✔
98
            Console\RuleMakeCommand::class,
96✔
99
            Console\ScopeMakeCommand::class,
96✔
100
            Console\SeederMakeCommand::class,
96✔
101
            Console\TestMakeCommand::class,
96✔
102

103
            Console\BatchesTableCommand::class,
96✔
104
            Console\FailedTableCommand::class,
96✔
105
            Console\NotificationTableCommand::class,
96✔
106
            Console\QueueTableCommand::class,
96✔
107
            Console\SessionTableCommand::class,
96✔
108
        ]);
96✔
109
    }
110

111
    /**
112
     * Register the command.
113
     *
114
     * @return void
115
     */
116
    protected function registerCastMakeCommand()
117
    {
118
        $this->app->singleton(CastMakeCommand::class, function ($app) {
96✔
119
            return new Console\CastMakeCommand($app['files']);
×
120
        });
96✔
121
    }
122

123
    /**
124
     * Register the command.
125
     *
126
     * @return void
127
     */
128
    protected function registerChannelMakeCommand()
129
    {
130
        $this->app->singleton(ChannelMakeCommand::class, function ($app) {
96✔
131
            return new Console\ChannelMakeCommand($app['files']);
×
132
        });
96✔
133
    }
134

135
    /**
136
     * Register the command.
137
     *
138
     * @return void
139
     */
140
    protected function registerComponentMakeCommand()
141
    {
142
        $this->app->singleton(ComponentMakeCommand::class, function ($app) {
96✔
143
            return new Console\ComponentMakeCommand($app['files']);
×
144
        });
96✔
145
    }
146

147
    /**
148
     * Register the command.
149
     *
150
     * @return void
151
     */
152
    protected function registerConsoleMakeCommand()
153
    {
154
        $this->app->singleton(ConsoleMakeCommand::class, function ($app) {
96✔
155
            return new Console\ConsoleMakeCommand($app['files']);
×
156
        });
96✔
157
    }
158

159
    /**
160
     * Register the command.
161
     *
162
     * @return void
163
     */
164
    protected function registerControllerMakeCommand()
165
    {
166
        $this->app->singleton(ControllerMakeCommand::class, function ($app) {
96✔
167
            return new Console\ControllerMakeCommand($app['files']);
×
168
        });
96✔
169
    }
170

171
    /**
172
     * Register the command.
173
     *
174
     * @return void
175
     */
176
    protected function registerEventMakeCommand()
177
    {
178
        $this->app->singleton(EventMakeCommand::class, function ($app) {
96✔
179
            return new Console\EventMakeCommand($app['files']);
×
180
        });
96✔
181
    }
182

183
    /**
184
     * Register the command.
185
     *
186
     * @return void
187
     */
188
    protected function registerExceptionMakeCommand()
189
    {
190
        $this->app->singleton(ExceptionMakeCommand::class, function ($app) {
96✔
191
            return new Console\ExceptionMakeCommand($app['files']);
×
192
        });
96✔
193
    }
194

195
    /**
196
     * Register the command.
197
     *
198
     * @return void
199
     */
200
    protected function registerFactoryMakeCommand()
201
    {
202
        $this->app->singleton(FactoryMakeCommand::class, function ($app) {
96✔
203
            return new Console\FactoryMakeCommand($app['files']);
×
204
        });
96✔
205
    }
206

207
    /**
208
     * Register the command.
209
     *
210
     * @return void
211
     */
212
    protected function registerJobMakeCommand()
213
    {
214
        $this->app->singleton(JobMakeCommand::class, function ($app) {
96✔
215
            return new Console\JobMakeCommand($app['files']);
×
216
        });
96✔
217
    }
218

219
    /**
220
     * Register the command.
221
     *
222
     * @return void
223
     */
224
    protected function registerListenerMakeCommand()
225
    {
226
        $this->app->singleton(ListenerMakeCommand::class, function ($app) {
96✔
227
            return new Console\ListenerMakeCommand($app['files']);
×
228
        });
96✔
229
    }
230

231
    /**
232
     * Register the command.
233
     *
234
     * @return void
235
     */
236
    protected function registerMailMakeCommand()
237
    {
238
        $this->app->singleton(MailMakeCommand::class, function ($app) {
96✔
239
            return new Console\MailMakeCommand($app['files']);
×
240
        });
96✔
241
    }
242

243
    /**
244
     * Register the command.
245
     *
246
     * @return void
247
     */
248
    protected function registerMiddlewareMakeCommand()
249
    {
250
        $this->app->singleton(MiddlewareMakeCommand::class, function ($app) {
96✔
251
            return new Console\MiddlewareMakeCommand($app['files']);
×
252
        });
96✔
253
    }
254

255
    /**
256
     * Register the command.
257
     *
258
     * @return void
259
     */
260
    protected function registerMigrateMakeCommand()
261
    {
262
        $this->app->singleton(MigrateMakeCommand::class, function ($app) {
96✔
263
            // Once we have the migration creator registered, we will create the command
264
            // and inject the creator. The creator is responsible for the actual file
265
            // creation of the migrations, and may be extended by these developers.
266
            $creator = $app['migration.creator'];
94✔
267

268
            $composer = $app['composer'];
94✔
269

270
            return new Console\MigrateMakeCommand($creator, $composer);
94✔
271
        });
96✔
272
    }
273

274
    /**
275
     * Register the command.
276
     *
277
     * @return void
278
     */
279
    protected function registerModelMakeCommand()
280
    {
281
        $this->app->singleton(ModelMakeCommand::class, function ($app) {
96✔
282
            return new Console\ModelMakeCommand($app['files']);
×
283
        });
96✔
284
    }
285

286
    /**
287
     * Register the command.
288
     *
289
     * @return void
290
     */
291
    protected function registerNotificationMakeCommand()
292
    {
293
        $this->app->singleton(NotificationMakeCommand::class, function ($app) {
96✔
294
            return new Console\NotificationMakeCommand($app['files']);
×
295
        });
96✔
296
    }
297

298
    /**
299
     * Register the command.
300
     *
301
     * @return void
302
     */
303
    protected function registerObserverMakeCommand()
304
    {
305
        $this->app->singleton(ObserverMakeCommand::class, function ($app) {
96✔
306
            return new Console\ObserverMakeCommand($app['files']);
×
307
        });
96✔
308
    }
309

310
    /**
311
     * Register the command.
312
     *
313
     * @return void
314
     */
315
    protected function registerPolicyMakeCommand()
316
    {
317
        $this->app->singleton(PolicyMakeCommand::class, function ($app) {
96✔
318
            return new Console\PolicyMakeCommand($app['files']);
×
319
        });
96✔
320
    }
321

322
    /**
323
     * Register the command.
324
     *
325
     * @return void
326
     */
327
    protected function registerProviderMakeCommand()
328
    {
329
        $this->app->singleton(ProviderMakeCommand::class, function ($app) {
96✔
330
            return new Console\ProviderMakeCommand($app['files']);
×
331
        });
96✔
332
    }
333

334
    /**
335
     * Register the command.
336
     *
337
     * @return void
338
     */
339
    protected function registerRequestMakeCommand()
340
    {
341
        $this->app->singleton(RequestMakeCommand::class, function ($app) {
96✔
342
            return new Console\RequestMakeCommand($app['files']);
×
343
        });
96✔
344
    }
345

346
    /**
347
     * Register the command.
348
     *
349
     * @return void
350
     */
351
    protected function registerResourceMakeCommand()
352
    {
353
        $this->app->singleton(ResourceMakeCommand::class, function ($app) {
96✔
354
            return new Console\ResourceMakeCommand($app['files']);
×
355
        });
96✔
356
    }
357

358
    /**
359
     * Register the command.
360
     *
361
     * @return void
362
     */
363
    protected function registerRuleMakeCommand()
364
    {
365
        $this->app->singleton(RuleMakeCommand::class, function ($app) {
96✔
366
            return new Console\RuleMakeCommand($app['files']);
×
367
        });
96✔
368
    }
369

370
    /**
371
     * Register the command.
372
     *
373
     * @return void
374
     */
375
    protected function registerScopeMakeCommand()
376
    {
377
        $this->app->singleton(ScopeMakeCommand::class, function ($app) {
96✔
378
            return new Console\ScopeMakeCommand($app['files']);
×
379
        });
96✔
380
    }
381

382
    /**
383
     * Register the command.
384
     *
385
     * @return void
386
     */
387
    protected function registerSeederMakeCommand()
388
    {
389
        $this->app->singleton(SeederMakeCommand::class, function ($app) {
96✔
390
            return new Console\SeederMakeCommand($app['files']);
×
391
        });
96✔
392
    }
393

394
    /**
395
     * Register the command.
396
     *
397
     * @return void
398
     */
399
    protected function registerTestMakeCommand()
400
    {
401
        $this->app->singleton(TestMakeCommand::class, function ($app) {
96✔
402
            return new Console\TestMakeCommand($app['files']);
×
403
        });
96✔
404
    }
405

406
    /**
407
     * Register the command.
408
     *
409
     * @return void
410
     */
411
    protected function registerNotificationTableCommand()
412
    {
413
        $this->app->singleton(NotificationTableCommand::class, function ($app) {
96✔
414
            return new Console\NotificationTableCommand($app['files'], $app['composer']);
×
415
        });
96✔
416
    }
417

418
    /**
419
     * Register the command.
420
     *
421
     * @return void
422
     */
423
    protected function registerQueueBatchesTableCommand()
424
    {
425
        $this->app->singleton(BatchesTableCommand::class, function ($app) {
96✔
426
            return new Console\BatchesTableCommand($app['files'], $app['composer']);
×
427
        });
96✔
428
    }
429

430
    /**
431
     * Register the command.
432
     *
433
     * @return void
434
     */
435
    protected function registerQueueFailedTableCommand()
436
    {
437
        $this->app->singleton(FailedTableCommand::class, function ($app) {
96✔
438
            return new Console\FailedTableCommand($app['files'], $app['composer']);
×
439
        });
96✔
440
    }
441

442
    /**
443
     * Register the command.
444
     *
445
     * @return void
446
     */
447
    protected function registerQueueTableCommand()
448
    {
449
        $this->app->singleton(QueueTableCommand::class, function ($app) {
96✔
450
            return new Console\QueueTableCommand($app['files'], $app['composer']);
×
451
        });
96✔
452
    }
453

454
    /**
455
     * Register the command.
456
     *
457
     * @return void
458
     */
459
    protected function registerSessionTableCommand()
460
    {
461
        $this->app->singleton(SessionTableCommand::class, function ($app) {
96✔
462
            return new Console\SessionTableCommand($app['files'], $app['composer']);
×
463
        });
96✔
464
    }
465

466
    /**
467
     * Get the services provided by the provider.
468
     *
469
     * @return array
470
     */
471
    public function provides()
472
    {
473
        return [
6✔
474
            CastMakeCommand::class,
6✔
475
            Console\CastMakeCommand::class,
6✔
476
            ChannelMakeCommand::class,
6✔
477
            Console\ChannelMakeCommand::class,
6✔
478
            ComponentMakeCommand::class,
6✔
479
            Console\ComponentMakeCommand::class,
6✔
480
            ConsoleMakeCommand::class,
6✔
481
            Console\ConsoleMakeCommand::class,
6✔
482
            ControllerMakeCommand::class,
6✔
483
            Console\ControllerMakeCommand::class,
6✔
484
            EventMakeCommand::class,
6✔
485
            Console\EventMakeCommand::class,
6✔
486
            ExceptionMakeCommand::class,
6✔
487
            Console\ExceptionMakeCommand::class,
6✔
488
            FactoryMakeCommand::class,
6✔
489
            Console\FactoryMakeCommand::class,
6✔
490
            JobMakeCommand::class,
6✔
491
            Console\JobMakeCommand::class,
6✔
492
            ListenerMakeCommand::class,
6✔
493
            Console\ListenerMakeCommand::class,
6✔
494
            MailMakeCommand::class,
6✔
495
            Console\MailMakeCommand::class,
6✔
496
            MiddlewareMakeCommand::class,
6✔
497
            Console\MiddlewareMakeCommand::class,
6✔
498
            MigrateMakeCommand::class,
6✔
499
            Console\MigrateMakeCommand::class,
6✔
500
            ModelMakeCommand::class,
6✔
501
            Console\ModelMakeCommand::class,
6✔
502
            NotificationMakeCommand::class,
6✔
503
            Console\NotificationMakeCommand::class,
6✔
504
            ObserverMakeCommand::class,
6✔
505
            Console\ObserverMakeCommand::class,
6✔
506
            PolicyMakeCommand::class,
6✔
507
            Console\PolicyMakeCommand::class,
6✔
508
            ProviderMakeCommand::class,
6✔
509
            Console\ProviderMakeCommand::class,
6✔
510
            RequestMakeCommand::class,
6✔
511
            Console\RequestMakeCommand::class,
6✔
512
            ResourceMakeCommand::class,
6✔
513
            Console\ResourceMakeCommand::class,
6✔
514
            RuleMakeCommand::class,
6✔
515
            Console\RuleMakeCommand::class,
6✔
516
            ScopeMakeCommand::class,
6✔
517
            Console\ScopeMakeCommand::class,
6✔
518
            SeederMakeCommand::class,
6✔
519
            Console\SeederMakeCommand::class,
6✔
520
            TestMakeCommand::class,
6✔
521
            Console\TestMakeCommand::class,
6✔
522

523
            BatchesTableCommand::class,
6✔
524
            Console\BatchesTableCommand::class,
6✔
525
            FailedTableCommand::class,
6✔
526
            Console\FailedTableCommand::class,
6✔
527
            NotificationTableCommand::class,
6✔
528
            Console\NotificationTableCommand::class,
6✔
529
            QueueTableCommand::class,
6✔
530
            Console\QueueTableCommand::class,
6✔
531
            SessionTableCommand::class,
6✔
532
            Console\SessionTableCommand::class,
6✔
533
        ];
6✔
534
    }
535
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc