Kundenhoheit
This commit is contained in:
parent
d8b5206031
commit
dc63fa9fb2
52 changed files with 2436 additions and 557 deletions
71
app/Repositories/CustomerRepository.php
Normal file
71
app/Repositories/CustomerRepository.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
class CustomerRepository extends BaseRepository {
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
//$this->model = $model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function update($data)
|
||||
{
|
||||
|
||||
/*if($data['user_id'] === "new" || $data['user_id'] == 0){
|
||||
|
||||
$this->model = User::create([
|
||||
'email' => $data['email'],
|
||||
'password' => env('APP_KEY'),
|
||||
]);
|
||||
}
|
||||
else{
|
||||
$this->model = $this->getById($data['user_id']);
|
||||
}
|
||||
|
||||
if(!$this->model->account_id){
|
||||
$account = new UserAccount();
|
||||
}else{
|
||||
$account = $this->model->account;
|
||||
}
|
||||
|
||||
$data['same_as_billing'] = !isset($data['same_as_billing']) ? 0 : 1;
|
||||
|
||||
$account->fill($data)->save();
|
||||
|
||||
if(!$this->model->account_id){
|
||||
$this->model->account_id = $account->id;
|
||||
$this->model->save();
|
||||
}*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function create($data){
|
||||
|
||||
/* $this->model = User::create([
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
|
||||
$account = UserAccount::create([
|
||||
'm_salutation' => $data['salutation'],
|
||||
'm_first_name' => $data['first_name'],
|
||||
'm_last_name' => $data['last_name'],
|
||||
'salutation' => $data['salutation'],
|
||||
'first_name' => $data['first_name'],
|
||||
'last_name' => $data['last_name'],
|
||||
]);
|
||||
|
||||
$this->model->account_id = $account->id;
|
||||
$this->model->save();
|
||||
|
||||
|
||||
return $this->model;*/
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue