ViewServiceProvider dependency in Validation Errors and Health Endpoint #54891
Replies: 3 comments
-
Attaching composer.json for reference. The case is also same with Laravel 12: {
"$schema": "https://getcomposer.org/schema.json",
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": [
"laravel",
"framework"
],
"license": "MIT",
"require": {
"php": "^8.2",
"laravel/framework": "^12.0",
"laravel/octane": "^2.8",
"laravel/tinker": "^2.10.1"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pint": "^1.13",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"phpunit/phpunit": "^11.5.3"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}
|
Beta Was this translation helpful? Give feedback.
-
For the health endpoint, you'll need to make your own route as Taylor has repeatedly rejected PRs to make the one built into the framework do anything but serve an HTML document. For validation errors, as long as the exception handler is handling a |
Beta Was this translation helpful? Give feedback.
-
It looks like there's a lot of overriding needs to be done. Recently sentry caught some errors requiring AuthServiceProvider for Gate usage somewhere. I guess Symfony is way to here. |
Beta Was this translation helpful? Give feedback.
-
Laravel Version
11
PHP Version
8.2
Database Driver & Version
MySQL 8 - Docker
Description
Since Lumen is no longer maintained, there must be some way to have API only configuration. I'm trying to build a micro service using Laravel 11. A simple service which would just take data -> process it and then -> store into database.
Now here I don't want to use any other service providers that are not needed for example I have disabled: Sessions, Authentication, Mail, removed default models, migrations and more.
But It looks like the framework requires ViewServiceProvider for validation errors thrown via validate methods and also for health endpoint. Currently getting:
Steps To Reproduce
bootstrap/app.php
config/app.php
routes/api.php
Now sending data to
/push
endpoint or visiting/health
will throw 500 error.Beta Was this translation helpful? Give feedback.
All reactions