Update CustomersController.php

This commit is contained in:
Bozhidar Slaveykov 2024-04-06 20:11:06 +03:00
parent 6de86e3c21
commit 1662578847

View file

@ -66,6 +66,33 @@ class CustomersController extends ApiController
$customer = new Customer();
$customer->name = $request->name;
$customer->email = $request->email;
if ($request->has('username')) {
$customer->username = $request->username;
}
if ($request->has('password')) {
$customer->password = $request->password;
}
if ($request->has('phone')) {
$customer->phone = $request->phone;
}
if ($request->has('address')) {
$customer->address = $request->address;
}
if ($request->has('city')) {
$customer->city = $request->city;
}
if ($request->has('state')) {
$customer->state = $request->state;
}
if ($request->has('zip')) {
$customer->zip = $request->zip;
}
if ($request->has('country')) {
$customer->country = $request->country;
}
if ($request->has('company')) {
$customer->company = $request->company;
}
$customer->save();
return response()->json([