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; } }
public function user() { return $this->hasMany(User::getClass()); }
public function user() { return $this->belongsTo(User::getClass()); }
public function reserva() { return $this->belongsToMany(User::getClass(), 'reserva'); }