} try { $amor->save(); return 1; } catch (Exception $ex) { return 0; } } else { return 0; } }); Route::post('/relaciones/{id}', function ($id) { $data = Input::all(); $count = DB::table('perfiles')->where('idPerfil', '=', $data['id'])->count(); if ($count == 1) { $relacion = new Relacion(); if ($id > 0 && $data['id'] > 0 && $data['id'] != $id) { $relacion->idPerfilBase = $id; $relacion->idPerfilRelacion = $data['id']; $res = $relacion->save(); } //return Response::json(Array('ok' => $res, 'errors' => $relacion->getErrors())); return Redirect::to('perfil/' . $id); } else { return Redirect::to('/perfiles'); } }); Route::post('/post/{id}', function ($id) { $data = Input::all(); // dd(Input::all()); $post = new Post();
public static function getJefes() { $admins = Relacion::model()->findAll('privilegio=3'); $return_name = array(); foreach ($admins as $admin) { $admin = User::model()->findbyPk($admin->id); } array_push($return_name, $admin->username); self::$_admins = $return_name ? $return_name : array(''); return self::$_admins; }