When my script fails in a Laravel 9 app, instead of it to outputing the JSON I configured, it shows this:
InvalidArgumentException: View [welcome] not found. in file C:\Users\kgl\Documents\biomandate\secure\vendor\laravel\framework\src\Illuminate\View\FileViewFinder.php on line 137
I think I need to adjust the App\Exceptions handler but somehow I still have error. Please how do I fix this?
For example: if the below code fails, I need the response to be something I have configured.
$user = new User();
$user->name = $validatedData['name'];
$user->email = $validatedData['email'];
$user->password = Hash::make($validatedData['password']);
$user->token = $token;
$user->save()
renderfunction. Loop through possible variations of the Exception, InvalidArgumentException is one of them. Let's say you do amatchon the Exception. If it's that InvalidArgumentException then handle it by .... showing a 404 not found page?