Beispiel #1
0
 public function beforeSave()
 {
     if ($this->type == "centro_educativo") {
         Push::alert(3, [str_replace(' ', '', $this->centro_educativo->nombre)], $this->centro_educativo->nombre);
     } else {
         Push::email(3, $this->encargado->password . "@vaclases.com", $this->encargado->nombre);
     }
 }
Beispiel #2
0
 public function beforeSave()
 {
     $this->dias = $this->fecha_inicio->diffForHumans($this->fecha_fin) + 1;
     $this->tipo = 1;
     Push::alert(0, [str_replace(' ', '', $this->centro_educativo->nombre)], $this->centro_educativo->nombre);
 }
Beispiel #3
0
            $r = ["status" => "error", "mensajes" => ["No se encontro el encargado, identidad incorrecta"]];
        }
    }
    return $r;
});
Route::get('logout', function () {
    if (Session::has('encargado')) {
        Session::forget('encargado');
        Session::flush();
        return ['status' => 'exito', "mensajes" => ["Se cerro la sesión con éxito"]];
    } else {
        return ['status' => 'error', "mensajes" => ["No existe una sesión para terminar"]];
    }
});
Route::get('push', function () {
    return Push::alert(2, ["InstitutoManuelPaganLozano"]);
});
Route::get('password/{id}', function ($id) {
    $data = get();
    $rules = ['old' => 'required', 'new' => 'required'];
    $validation = Validator::make($data, $rules);
    if ($validation->fails()) {
        return ["status" => "error", "mensajes" => $validation->messages()];
    } else {
        if ($en = Encargado::where("identidad", $id)->first()) {
            if ($en->password == $data['old']) {
                $en->password = $data['new'];
                $en->save();
                return ["status" => "exito", "mensajes" => ["Se cambio la clave con éxito"]];
            } else {
                return ["status" => "error", "mensajes" => ["La clave anterior no es valida"]];
Beispiel #4
0
 public function beforeSave()
 {
     Push::alert(1, [str_replace(' ', '', $this->centro_educativo->nombre)], $this->centro_educativo->nombre);
 }