From f2f06d1c947e1fc1f8a6f2a4494328bfe77ee18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Sat, 21 Sep 2024 13:05:12 +0200 Subject: [PATCH 1/5] chore(laravel): add close PR action and README (#6656) * chore: add close PR action and README for Laravel component * rename --- src/Laravel/.github/workflows/close_pr.yml | 13 +++++++++++++ src/Laravel/README.md | 13 +++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/Laravel/.github/workflows/close_pr.yml diff --git a/src/Laravel/.github/workflows/close_pr.yml b/src/Laravel/.github/workflows/close_pr.yml new file mode 100644 index 00000000000..72a8ab4325e --- /dev/null +++ b/src/Laravel/.github/workflows/close_pr.yml @@ -0,0 +1,13 @@ +name: Close Pull Request + +on: + pull_request_target: + types: [opened] + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: "Thank you for your pull request. However, you have submitted this PR on a read-only sub split of `api-platform/core`. Please submit your PR on the https://github.com/api-platform/core repository.

Thanks!" diff --git a/src/Laravel/README.md b/src/Laravel/README.md index 4fe1aaa712c..dd8b2d53c6f 100644 --- a/src/Laravel/README.md +++ b/src/Laravel/README.md @@ -1,3 +1,12 @@ -# Laravel Integration of API Platform +# API Platform for Laravel -Integrates [API Platform](https://api-platform.com) into the [Laravel](https://laravel.com) framework and the Illuminate components. +Integration of [Laravel](https://laravel.com) and the Illuminate components with the [API Platform](https://api-platform.com) framework. + +[Documentation](https://api-platform.com/docs/laravel/) + +> [!CAUTION] +> +> This is a read-only sub split of `api-platform/core`, please +> [report issues](https://github.com/api-platform/core/issues) and +> [send Pull Requests](https://github.com/api-platform/core/pulls) +> in the [core API Platform repository](https://github.com/api-platform/core). From 88bd8c3e151c843649bcac3feefc2cb956212410 Mon Sep 17 00:00:00 2001 From: Tobias Oitzinger <42447585+toitzi@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:06:18 +0200 Subject: [PATCH 2/5] fix(laravel): installation command, fix config overwrites (#6649) added the installation command, but as a bug fix since configs are currently getting overwritten. Closes: #6645 --- src/Laravel/ApiPlatformProvider.php | 8 +++-- src/Laravel/Console/InstallCommand.php | 45 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 src/Laravel/Console/InstallCommand.php diff --git a/src/Laravel/ApiPlatformProvider.php b/src/Laravel/ApiPlatformProvider.php index d11885ab54f..544980fa9bb 100644 --- a/src/Laravel/ApiPlatformProvider.php +++ b/src/Laravel/ApiPlatformProvider.php @@ -1055,6 +1055,10 @@ function (Application $app) { if ($this->app['config']->get('api-platform.graphql.enabled')) { $this->registerGraphQl($this->app); } + + if ($this->app->runningInConsole()) { + $this->commands([Console\InstallCommand::class]); + } } private function registerGraphQl(Application $app): void @@ -1210,11 +1214,11 @@ public function boot(ResourceNameCollectionFactoryInterface $resourceNameCollect if ($this->app->runningInConsole()) { $this->publishes([ __DIR__.'/config/api-platform.php' => $this->app->configPath('api-platform.php'), - ], 'laravel-assets'); + ], 'api-platform-config'); $this->publishes([ __DIR__.'/public' => $this->app->publicPath('vendor/api-platform'), - ], 'laravel-assets'); + ], ['api-platform-assets', 'public']); } $this->loadViewsFrom(__DIR__.'/resources/views', 'api-platform'); diff --git a/src/Laravel/Console/InstallCommand.php b/src/Laravel/Console/InstallCommand.php new file mode 100644 index 00000000000..ebd48482702 --- /dev/null +++ b/src/Laravel/Console/InstallCommand.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Laravel\Console; + +use Illuminate\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; + +#[AsCommand(name: 'api-platform:install')] +class InstallCommand extends Command +{ + /** + * @var string + */ + protected $signature = 'api-platform:install'; + + /** + * @var string + */ + protected $description = 'Install all of the API Platform resources'; + + /** + * Execute the console command. + */ + public function handle(): void + { + $this->comment('Publishing API Platform Assets...'); + $this->callSilent('vendor:publish', ['--tag' => 'api-platform-assets']); + + $this->comment('Publishing API Platform Configuration...'); + $this->callSilent('vendor:publish', ['--tag' => 'api-platform-config']); + + $this->info('API Platform installed successfully.'); + } +} From 05f7d795252d32424b49336e5184557569809796 Mon Sep 17 00:00:00 2001 From: soyuka Date: Mon, 23 Sep 2024 09:27:56 +0200 Subject: [PATCH 3/5] docs: changelog 3.4.1 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d30a1e2f4d6..8169f6c00e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## v3.4.1 + +### Bug fixes + +* [219199db3](https://github.com/api-platform/core/commit/219199db386cab05f1c1225b889c0a9609b36699) fix(symfony): missing alias to serializer context builder interface (#6643) +* [5f943e3bb](https://github.com/api-platform/core/commit/5f943e3bb56934ba5d0b858f6b4c20a2985b6b6b) fix(graphql): wrong exception namespace (#6647) +* [93314b08d](https://github.com/api-platform/core/commit/93314b08de1e6f0505af9e3a3ba3d9971f1ef09c) fix(serializer): allow state's SerializerFilterContextBuilderInterface (#6632) +* [9a0afc917](https://github.com/api-platform/core/commit/9a0afc917a4bfa824ffbb640af9bb1114a5d31b4) fix(serializer): remove unnecessary dependency +* [e327f5f69](https://github.com/api-platform/core/commit/e327f5f69c823c1ed674eefc0eb2551e30fb36bd) fix(symfony): namespace of path segment name generator services (#6642) + ## v3.4.0 ### Deprecations: From 1cf0a13d30c9616cb4c959d728e2305e305199b8 Mon Sep 17 00:00:00 2001 From: soyuka Date: Mon, 23 Sep 2024 09:37:46 +0200 Subject: [PATCH 4/5] docs: changelog 4.0.2 --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bf363a9d93..39e52d12de0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## v4.0.2 + +### Bug fixes + +* [219199db3](https://github.com/api-platform/core/commit/219199db386cab05f1c1225b889c0a9609b36699) fix(symfony): missing alias to serializer context builder interface (#6643) +* [5f943e3bb](https://github.com/api-platform/core/commit/5f943e3bb56934ba5d0b858f6b4c20a2985b6b6b) fix(graphql): wrong exception namespace (#6647) +* [72a0b669a](https://github.com/api-platform/core/commit/72a0b669a426ca4bbbf14cf80a6ced683b947e8c) fix(serializer): remove serializer context builder interface +* [88bd8c3e1](https://github.com/api-platform/core/commit/88bd8c3e151c843649bcac3feefc2cb956212410) fix(laravel): installation command, fix config overwrites (#6649) +* [93314b08d](https://github.com/api-platform/core/commit/93314b08de1e6f0505af9e3a3ba3d9971f1ef09c) fix(serializer): allow state's SerializerFilterContextBuilderInterface (#6632) +* [9a0afc917](https://github.com/api-platform/core/commit/9a0afc917a4bfa824ffbb640af9bb1114a5d31b4) fix(serializer): remove unnecessary dependency +* [c47e2996e](https://github.com/api-platform/core/commit/c47e2996e51c587c998fde88903703bd6ac9a43c) fix: default format and standard_put values +* [e327f5f69](https://github.com/api-platform/core/commit/e327f5f69c823c1ed674eefc0eb2551e30fb36bd) fix(symfony): namespace of path segment name generator services (#6642) + +Notes: + +`standard_put=true` is now the default, you can set it to `false` using `extra_properties.defaults` + ## v4.0.1 ### Bug fixes From 121a328059af90e32862b014d406f373f69f4ba1 Mon Sep 17 00:00:00 2001 From: soyuka Date: Mon, 23 Sep 2024 13:05:19 +0200 Subject: [PATCH 5/5] ci: missing versions --- .github/workflows/subtree.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/subtree.yml b/.github/workflows/subtree.yml index 394f1c7cb1e..1e2969a9e3a 100644 --- a/.github/workflows/subtree.yml +++ b/.github/workflows/subtree.yml @@ -5,8 +5,11 @@ on: - v* branches: - main - - 3.1 - - 3.2 + - '3.1' + - '3.2' + - '3.3' + - '3.4' + - '4.0' env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}