api for modify customer profile
-
This post is deleted! -
wow not even any one would help !!!
-
@cmpengineers
Use PUT method to update customer profile.
Data for all required fields need to be pass to update profile -
Dear @Jyoti
you mean i have to pass all these
id :
first_name:
last_name:
email:
password:
password_confirmation:
gender:
group :
data_of_birth:
phone:
created_at:
updated_at:Correct ?
best regards
-
No, need to pass only required fields and data for field that you want to update.
-
-
Dear @Jyoti
i have found the function for the api
$customer = auth($this->guard)->user(); $this->validate(request(), [ 'first_name' => 'required', 'last_name' => 'required', 'gender' => 'required', 'date_of_birth' => 'nullable|date|before:today', 'email' => 'email|unique:customers,email,' . $customer->id, 'password' => 'confirmed|min:6' ]);
Route::put('customer/profile', 'SessionController@update');
when i tried to update it give me error Route [auth.login] in Postman
Please advise
Best regards
-
Dear @Jyoti
How do you authenticate (login) and at the same time modify in Postman , im confused
-
Dear @Jyoti
i managed to login and then create another link to modify its working but not sure why is asking for fields that i already is sending
Best regards
-
@cmpengineers
Make sure that in header content type application/json is added -
Make content-type as application/json and send put data in json formate
like{ "email": "[email protected]", "first_name": "New", "last_name": "Name", "gender": "Male", "date_of_birth": null, "phone": null }