Beispiel #1
0
        } 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();
    $post->idAlias = Session::get('usuario')->idAlias;
    $post->idPerfil = $id;
    $post->tipo = 5;
    $doSave = true;