I'm trying to make api with basic auth in Laravel 5.5.48
When auth is success ('username' and 'password') response is correct, but if auth is unsuccess(wrong 'username' and 'password' data) displays error
What I haven't tried, but I couldn't change Exception displays on my response (response()->json(['status'=>'auth failed']))
routes/api.php
Route::post('/index', 'Api\MyController@index')->middleware('auth.basic');
app/Http/Controllers/Api/MyController@index
public function index(Request $request)
{
return response()->json(array('status' => 'success'));
}