mercredi 15 juin 2016

Api restful laravel 5.2

How can do i api restful with multi auth. one for web and other to api?

i'm try using auth:api but i want to pass the login and password, not only api_token.

My route:

Route::get('/', function () {
     return redirect('/home');
});

Route::auth();

Route::get('/home', 'HomeController@index');


Route::group(['prefix' => 'api/v1', 'middleware' => 'auth:api'], function () {
    Route::get('/d', function () {
        return Auth::guard('api')->user();
    });
});

thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire