lundi 29 février 2016

Laravel 5.2 Dingo API InternalRequest NotFoundHttpException

I always get NotFoundHttpException error when trying to access Dingo API InternalRequest.

My Controller:

use Dingo\Api\Routing\Helpers;

class C_Users extends Controller { use Helpers;

public $dispatcher;
public function __construct()
{
    $this->dispatcher = app('Dingo\Api\Dispatcher');
}

public function loginPost(Request $request)
{
    $response = $this->dispatcher
        ->json([
            'email'     => $request->input('email'),
            'password'  => $request->input('password')
        ])
        ->post('api/login');

    $responseArray = json_decode($response, true);

    if (!empty($responseArray) && $responseArray['status'] == 'success')
    {
        return response()->view('home');
    }
    else
    {
        return response()->view('auth.login', [$responseArray['messages']]);
    }
}   

}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire