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

orchestral / canvas / 6224137920

18 Sep 2023 02:42PM UTC coverage: 90.984% (+1.0%) from 89.945%
6224137920

push

github

crynobone
wip

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

603 of 603 new or added lines in 34 files covered. (100.0%)

555 of 610 relevant lines covered (90.98%)

24.54 hits per line

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

86.74
/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\Foundation\Console\ViewMakeCommand;
29
use Illuminate\Routing\Console\ControllerMakeCommand;
30
use Illuminate\Routing\Console\MiddlewareMakeCommand;
31
use Illuminate\Support\ServiceProvider;
32

33
class LaravelServiceProvider extends ServiceProvider implements DeferrableProvider
34
{
35
    /**
36
     * The commands to be registered.
37
     *
38
     * @var array
39
     */
40
    protected $devCommands = [
41
        // 'NotificationTable' => NotificationTableCommand::class,
42
        // 'QueueFailedTable' => FailedTableCommand::class,
43
        // 'QueueTable' => TableCommand::class,
44
        // 'QueueBatchesTable' => BatchesTableCommand::class,
45
        // 'SessionTable' => SessionTableCommand::class,
46
    ];
47

48
    /**
49
     * Register the service provider.
50
     *
51
     * @return void
52
     */
53
    public function register()
54
    {
55
        $this->registerCastMakeCommand();
93✔
56
        $this->registerChannelMakeCommand();
93✔
57
        $this->registerComponentMakeCommand();
93✔
58
        $this->registerConsoleMakeCommand();
93✔
59
        $this->registerControllerMakeCommand();
93✔
60
        $this->registerEventMakeCommand();
93✔
61
        $this->registerExceptionMakeCommand();
93✔
62
        $this->registerFactoryMakeCommand();
93✔
63
        $this->registerJobMakeCommand();
93✔
64
        $this->registerListenerMakeCommand();
93✔
65
        $this->registerMailMakeCommand();
93✔
66
        $this->registerMiddlewareMakeCommand();
93✔
67
        $this->registerMigrateMakeCommand();
93✔
68
        $this->registerModelMakeCommand();
93✔
69
        $this->registerNotificationMakeCommand();
93✔
70
        $this->registerObserverMakeCommand();
93✔
71
        $this->registerPolicyMakeCommand();
93✔
72
        $this->registerProviderMakeCommand();
93✔
73
        $this->registerRequestMakeCommand();
93✔
74
        $this->registerResourceMakeCommand();
93✔
75
        $this->registerRuleMakeCommand();
93✔
76
        $this->registerScopeMakeCommand();
93✔
77
        $this->registerSeederMakeCommand();
93✔
78
        $this->registerTestMakeCommand();
93✔
79
        $this->registerViewMakeCommand();
93✔
80

81
        $this->commands([
93✔
82
            Console\CastMakeCommand::class,
93✔
83
            Console\ChannelMakeCommand::class,
93✔
84
            Console\ComponentMakeCommand::class,
93✔
85
            Console\ConsoleMakeCommand::class,
93✔
86
            Console\ControllerMakeCommand::class,
93✔
87
            Console\EventMakeCommand::class,
93✔
88
            Console\ExceptionMakeCommand::class,
93✔
89
            Console\FactoryMakeCommand::class,
93✔
90
            Console\JobMakeCommand::class,
93✔
91
            Console\ListenerMakeCommand::class,
93✔
92
            Console\MailMakeCommand::class,
93✔
93
            Console\MiddlewareMakeCommand::class,
93✔
94
            Console\MigrateMakeCommand::class,
93✔
95
            Console\ModelMakeCommand::class,
93✔
96
            Console\NotificationMakeCommand::class,
93✔
97
            Console\ObserverMakeCommand::class,
93✔
98
            Console\PolicyMakeCommand::class,
93✔
99
            Console\ProviderMakeCommand::class,
93✔
100
            Console\RequestMakeCommand::class,
93✔
101
            Console\ResourceMakeCommand::class,
93✔
102
            Console\RuleMakeCommand::class,
93✔
103
            Console\ScopeMakeCommand::class,
93✔
104
            Console\SeederMakeCommand::class,
93✔
105
            Console\TestMakeCommand::class,
93✔
106
            Console\ViewMakeCommand::class,
93✔
107
        ]);
93✔
108
    }
109

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

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

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

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

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

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

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

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

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

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

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

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

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

267
            $composer = $app['composer'];
91✔
268

269
            return new Console\MigrateMakeCommand($creator, $composer);
91✔
270
        });
93✔
271
    }
272

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

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

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

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

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

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

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

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

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

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

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

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

417
    /**
418
     * Get the services provided by the provider.
419
     *
420
     * @return array
421
     */
422
    public function provides()
423
    {
424
        return [
1✔
425
            CastMakeCommand::class,
1✔
426
            Console\CastMakeCommand::class,
1✔
427
            ChannelMakeCommand::class,
1✔
428
            Console\ChannelMakeCommand::class,
1✔
429
            ComponentMakeCommand::class,
1✔
430
            Console\ComponentMakeCommand::class,
1✔
431
            ConsoleMakeCommand::class,
1✔
432
            Console\ConsoleMakeCommand::class,
1✔
433
            ControllerMakeCommand::class,
1✔
434
            Console\ControllerMakeCommand::class,
1✔
435
            EventMakeCommand::class,
1✔
436
            Console\EventMakeCommand::class,
1✔
437
            ExceptionMakeCommand::class,
1✔
438
            Console\ExceptionMakeCommand::class,
1✔
439
            FactoryMakeCommand::class,
1✔
440
            Console\FactoryMakeCommand::class,
1✔
441
            JobMakeCommand::class,
1✔
442
            Console\JobMakeCommand::class,
1✔
443
            ListenerMakeCommand::class,
1✔
444
            Console\ListenerMakeCommand::class,
1✔
445
            MailMakeCommand::class,
1✔
446
            Console\MailMakeCommand::class,
1✔
447
            MiddlewareMakeCommand::class,
1✔
448
            Console\MiddlewareMakeCommand::class,
1✔
449
            MigrateMakeCommand::class,
1✔
450
            Console\MigrateMakeCommand::class,
1✔
451
            ModelMakeCommand::class,
1✔
452
            Console\ModelMakeCommand::class,
1✔
453
            NotificationMakeCommand::class,
1✔
454
            Console\NotificationMakeCommand::class,
1✔
455
            ObserverMakeCommand::class,
1✔
456
            Console\ObserverMakeCommand::class,
1✔
457
            PolicyMakeCommand::class,
1✔
458
            Console\PolicyMakeCommand::class,
1✔
459
            ProviderMakeCommand::class,
1✔
460
            Console\ProviderMakeCommand::class,
1✔
461
            RequestMakeCommand::class,
1✔
462
            Console\RequestMakeCommand::class,
1✔
463
            ResourceMakeCommand::class,
1✔
464
            Console\ResourceMakeCommand::class,
1✔
465
            RuleMakeCommand::class,
1✔
466
            Console\RuleMakeCommand::class,
1✔
467
            ScopeMakeCommand::class,
1✔
468
            Console\ScopeMakeCommand::class,
1✔
469
            SeederMakeCommand::class,
1✔
470
            Console\SeederMakeCommand::class,
1✔
471
            TestMakeCommand::class,
1✔
472
            Console\TestMakeCommand::class,
1✔
473
            ViewMakeCommand::class,
1✔
474
            Console\ViewMakeCommand::class,
1✔
475
        ];
1✔
476
    }
477
}
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