Example #1
0
 public function registrarNuevoUsuario(array $data)
 {
     $dato = $this->newQuery()->where('email', '=', $data['email'])->get()->count();
     if ($dato == 0) {
         $usuario = User::create(['email' => $data['email'], 'estado' => 'Enable', 'password' => bcrypt('secret')]);
         return $usuario->id;
     } else {
         return 0;
     }
 }
Example #2
0
 public function user()
 {
     return $this->hasMany(User::getClass());
 }
Example #3
0
 public function user()
 {
     return $this->belongsTo(User::getClass());
 }
Example #4
0
 public function reserva()
 {
     return $this->belongsToMany(User::getClass(), 'reserva');
 }