Update CustomersController.php
This commit is contained in:
parent
6de86e3c21
commit
1662578847
1 changed files with 27 additions and 0 deletions
|
@ -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([
|
||||
|
|
Loading…
Reference in a new issue