Пример #1
0
 /**
  * Store a newly created resource in storage.
  *     * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $opening = new Opening();
     $opening->amount = Input::get('amount');
     $opening->save();
     return view('opening.index', ['openings' => Opening::all()]);
 }
 public function delete($opening_id)
 {
     $opening = Opening::findOrFail($opening_id);
     $bridge = Bridge::findOrFail($opening->bridge_id);
     $bridge->openings_total -= 1;
     $bridge->save();
     $opening->delete();
     return redirect('bridges/' . $bridge->id);
 }
 public function delete($type, $opening_id)
 {
     $opening = Opening::findOrFail($opening_id);
     $bridge = Bridge::findOrFail($opening->bridge_id);
     $bridge->openings_total -= 1;
     $ship = Ship::findOrFail($opening->ship_id);
     $ship->strippen_total += 1;
     $bridge->save();
     $ship->save();
     $opening->delete();
     if ($type == 'ship') {
         return redirect('openings/showtype/ship/' . $ship->id);
     }
     if ($type == 'bridge') {
         return redirect('openings/showtype/bridge/' . $bridge->id);
     }
     if ($type == 'user') {
         return redirect('openings/showtype/user/1');
     }
 }
Пример #4
0
 public function invitationRegister(Request $request)
 {
     $this->validate($request, ['email' => 'required|unique:openings|max:100']);
     Opening::create($request->all());
     Flash::success('از عضویت شما در خبرنامه Skillema سپاسگزاریم. ما شما را از آخرین رویدادهای Skillema با خبر می کنیم.');
     return redirect()->back();
 }