I'm doing a JWT login and at the time of testing the route I get an error:
MethodNotAllowedHttpException
routes.php
Route::group(['middleware'=>'cors'], function(){
Route::post('/auth_login', 'ApiAuthController@userAuth');
});
ApiAuthController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
class ApiAuthController extends Controller
{
public function userAuth(Request $requet){
$credentials = $request->only('email','password');
$token = null;
try{
if(!$token = JWTAuth::attempt($credentials)){
return response()->json('error','invalid credentials');
}
}catch(JWTException $ex){
return responsee()->json(['error'=>'somthing_went_worng'],500);
}
return response()->json(compact('token'));
}
}
Why is this error?