File tree Expand file tree Collapse file tree 2 files changed +51
-2
lines changed Expand file tree Collapse file tree 2 files changed +51
-2
lines changed Original file line number Diff line number Diff line change @@ -1055,6 +1055,10 @@ function (Application $app) {
1055
1055
if ($ this ->app ['config ' ]->get ('api-platform.graphql.enabled ' )) {
1056
1056
$ this ->registerGraphQl ($ this ->app );
1057
1057
}
1058
+
1059
+ if ($ this ->app ->runningInConsole ()) {
1060
+ $ this ->commands ([Console \InstallCommand::class]);
1061
+ }
1058
1062
}
1059
1063
1060
1064
private function registerGraphQl (Application $ app ): void
@@ -1210,11 +1214,11 @@ public function boot(ResourceNameCollectionFactoryInterface $resourceNameCollect
1210
1214
if ($ this ->app ->runningInConsole ()) {
1211
1215
$ this ->publishes ([
1212
1216
__DIR__ .'/config/api-platform.php ' => $ this ->app ->configPath ('api-platform.php ' ),
1213
- ], 'laravel-assets ' );
1217
+ ], 'api-platform-config ' );
1214
1218
1215
1219
$ this ->publishes ([
1216
1220
__DIR__ .'/public ' => $ this ->app ->publicPath ('vendor/api-platform ' ),
1217
- ], ' laravel- assets ' );
1221
+ ], [ ' api-platform- assets ', ' public ' ] );
1218
1222
}
1219
1223
1220
1224
$ this ->loadViewsFrom (__DIR__ .'/resources/views ' , 'api-platform ' );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the API Platform project.
5
+ *
6
+ * (c) Kévin Dunglas <[email protected] >
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ declare (strict_types=1 );
13
+
14
+ namespace ApiPlatform \Laravel \Console ;
15
+
16
+ use Illuminate \Console \Command ;
17
+ use Symfony \Component \Console \Attribute \AsCommand ;
18
+
19
+ #[AsCommand(name: 'api-platform:install ' )]
20
+ class InstallCommand extends Command
21
+ {
22
+ /**
23
+ * @var string
24
+ */
25
+ protected $ signature = 'api-platform:install ' ;
26
+
27
+ /**
28
+ * @var string
29
+ */
30
+ protected $ description = 'Install all of the API Platform resources ' ;
31
+
32
+ /**
33
+ * Execute the console command.
34
+ */
35
+ public function handle (): void
36
+ {
37
+ $ this ->comment ('Publishing API Platform Assets... ' );
38
+ $ this ->callSilent ('vendor:publish ' , ['--tag ' => 'api-platform-assets ' ]);
39
+
40
+ $ this ->comment ('Publishing API Platform Configuration... ' );
41
+ $ this ->callSilent ('vendor:publish ' , ['--tag ' => 'api-platform-config ' ]);
42
+
43
+ $ this ->info ('API Platform installed successfully. ' );
44
+ }
45
+ }
You can’t perform that action at this time.
0 commit comments