Laravel get input data from POST request in a rest api - development

Laravel get input data from POST request in a rest api

i’m trying to get input data which i post them from rest api as an json format, but in laravel i can’t get them on controller and that return empty array of request

my api route:

Route::group(['prefix' => 'v1', 'namespace' => 'Apiv1'], function () {
    $this->post('login', 'ApiController@login');
});

and ApiController:

<?php

namespace AppHttpControllersApiv1;

use AppHttpControllersController;
use IlluminateHttpRequest;
use IlluminateSupportFacadesValidator;

class ApiController extends Controller
{

    public function login(Request $request)
    {
        dd($request->all());
    }
}

output:

[]

ScreenShot

Laravel get input data from POST request in a rest api



from Laravel Questions and Answers https://laravelquestions.com/laravel/laravel-get-input-data-from-post-request-in-a-rest-api/
via Lzo Media

Comments

Popular posts from this blog

ng-show doesn’t work correct with value boolean

Using PHP and MySQL data to generate PDF letters like in MS Word mailmerge functionality - development

ng-include of inline SVG does not display gradient except in Chrome