01 2020
This commit is contained in:
parent
f117f79bb9
commit
3711fcc8d0
101 changed files with 4027 additions and 918 deletions
|
|
@ -4,6 +4,8 @@ namespace App\Repositories;
|
|||
|
||||
use App\Models\UserAccount;
|
||||
use App\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
|
||||
|
||||
class UserRepository extends BaseRepository {
|
||||
|
|
@ -15,6 +17,7 @@ class UserRepository extends BaseRepository {
|
|||
}
|
||||
|
||||
|
||||
|
||||
public function update($data)
|
||||
{
|
||||
|
||||
|
|
@ -44,7 +47,30 @@ class UserRepository extends BaseRepository {
|
|||
$this->model->save();
|
||||
}
|
||||
|
||||
return;
|
||||
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;
|
||||
}
|
||||
|
||||
public function deleteUser(User $user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue