skip to Main Content

Laravel Form Validation redirecting to web routes when it fails

I have a Laravel app (v10.30.1) this api routes block: <?php use AppHttpControllersEmployeeController; use IlluminateSupportFacadesRoute; Route::prefix('v1')->group(function () { Route::resource('employees', EmployeeController::class) ->only(['store', 'index', 'update']); });``` This method in EmployeeController: /** * Update an existing employee. * * @param IlluminateHttpRequest $request *…

VIEW QUESTION

Laravel Custom Requqest Is not woring

So I was trying to use Laravel custom request, following the documentation: api.php Route::post('/register-user', [AuthController::class, 'register']); AuthController.php: namespace AppHttpControllers; use AppHttpRequestsTestRequest; use IlluminateRoutingController as BaseController; class AuthController extends BaseController { /** * Register a new user * @param TestRequest $request…

VIEW QUESTION
Back To Top
Search