Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2. namespace TinyURL\Repository\User;
  3. use Illuminate\Support\Facades\Hash;
  4. class DbUserRepository implements UserRepositoryInterface
  5. {
  6.     protected $_model;
  7.  
  8.     public function __construct($model)
  9.     {
  10.         $this->_model = $model;
  11.     }
  12.  
  13.     public function create($name, $email, $password)
  14.     {
  15.         $user = $this->_model;
  16.         $user->name = $name;
  17.         $user->email = $email;
  18.         $user->password = Hash::make($password);
  19.         $user->remember_token = str_random(64);
  20.         $user->save();
  21.         return $user->name;
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement