lundi 10 septembre 2018

Laravel 5.5 Api Registration issue

I have been trying to get this api up and running and keep on experiencing this error when I test in Postman.

1. api.php
Route::group(['middleware' => ['api','cors']], function () {
     Route::post('auth/register', 'Auth\RegisterController@create');
});

2. RegisterController 
    protected function create(array $data)
{
    return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => bcrypt($data['password']),
    ]);
}}

  1. Postman configuration set to Post, the body is set to raw and JSON(application/json) Below is the postman json code.

    { "name": "Walter White", "email": "wwhite@someemaildomain.net", "password": "testpassword" }

Below is the error Too few arguments to function App\Http\Controllers\Auth\RegisterController::create(), 0 passed and exactly 1 expected in file C:\xampp\examplestuff



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2O9dnMp
via IFTTT

Aucun commentaire:

Enregistrer un commentaire