示例#1
0
 public static function actualizaP($request, $id)
 {
     try {
         DB::transaction(function () use($request, $id) {
             DB::table('plazas')->where('id', $id)->lockForUpdate()->get();
             $plaza = Plazas::find($id);
             $plaza->fill($request->all());
             $plaza->save();
         });
         Session::flash('view', 'act');
         Session::flash('header', '¡Éxito!');
         Session::flash('status', 'success');
         Session::flash('message', 'Se ha realizado la actualización correctamente.');
     } catch (\Exception $e) {
         Session::flash('header', '¡Ups!');
         Session::flash('status', 'fail');
         Session::flash('message', 'Parece que algo ha salido mal.');
     }
 }
示例#2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $Plazas = Plazas::find($id);
     return view('editar', ['Plazas' => $Plazas]);
 }