当前位置: 首页>>代码示例>>PHP>>正文


PHP Session::flash方法代码示例

本文整理汇总了PHP中App\Http\Controllers\Session::flash方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::flash方法的具体用法?PHP Session::flash怎么用?PHP Session::flash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在App\Http\Controllers\Session的用法示例。


在下文中一共展示了Session::flash方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $input = Request::all();
     Recipe::create($input);
     \Session::flash('flash_message', 'Your recipe has been stored!');
     return redirect('recipes');
 }
开发者ID:johnsonjsyuen,项目名称:SadBoys,代码行数:13,代码来源:RecipeController.php

示例2: getDoDelete

 public function getDoDelete($pets_id)
 {
     $pets = \App\Pet::find($pets_id);
     $pets->delete();
     \Session::flash('flash_message', 'Your Pet has been deleted.');
     return redirect('/profile');
 }
开发者ID:horstmyer,项目名称:p4,代码行数:7,代码来源:ProfilesController.php

示例3: storeSubResponder

 public function storeSubResponder(Request $request)
 {
     $sub_cat = $request['subCatID'];
     $result = CaseResponder::where('sub_category', '=', $sub_cat)->where('sub_sub_category', '=', 0)->first();
     if ($result) {
         $result->firstResponder = $request['firstResponder'];
         $result->secondResponder = $request['secondResponder'];
         $result->thirdResponder = $request['thirdResponder'];
         $result->save();
         \Session::flash('success', 'Responders have been successfully added!');
         return redirect()->back();
     } else {
         $responder = new CaseResponder();
         $responder->department = $request['deptID'];
         $responder->category = $request['catID'];
         $responder->sub_category = $request['subCatID'];
         $responder->firstResponder = $request['firstResponder'];
         $responder->secondResponder = $request['secondResponder'];
         $responder->thirdResponder = $request['thirdResponder'];
         $responder->active = 1;
         $responder->save();
         \Session::flash('success', 'Responders have been successfully added!');
         return redirect()->back();
     }
 }
开发者ID:elieishimwe,项目名称:Siyaleader-Transnet,代码行数:25,代码来源:RespondersController.php

示例4: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($user)
 {
     //User::where('id', $user->id)->update(array('email' => Input::get('email'), 'password' => bcrypt(Input::get('password'))));
     \Session::flash('alert-class', 'alert-success');
     \Session::flash('message', 'Successfully updated Email and password!');
     return view('pages/users.show', compact('user'));
     /*
     		// validate
             // read more on validation at http://laravel.com/docs/validation
             $rules = array(
      'name'       => 'required',
      'email'      => 'required|email',
      'nerd_level' => 'required|numeric'
             );
     		 $validator = Validator::make(Input::all(), $rules);
     
             // process the login
             if ($validator->fails()) {
      return Redirect::to('nerds/' . $id . '/edit')
          ->withErrors($validator)
          ->withInput(Input::except('password'));
             } else {
      // store
      $nerd = Nerd::find($id);
      $nerd->name       = Input::get('name');
      $nerd->email      = Input::get('email');
      $nerd->nerd_level = Input::get('nerd_level');
      $nerd->save();
     
      // redirect
      Session::flash('message', 'Successfully updated nerd!');
      return Redirect::to('nerds');
     */
 }
开发者ID:jenidarnold,项目名称:racquetball,代码行数:40,代码来源:UserController.php

示例5: update

 public function update($id, Requests\TasklistRequest $request)
 {
     $tasklists = Tasklist::findOrFail($id);
     $tasklists->update($request->all());
     \Session::flash('flash_message', 'Task wurde geändert!');
     return redirect('tasklist');
 }
开发者ID:Vienna-Ticket-Office,项目名称:VTO-Admin,代码行数:7,代码来源:TasklistController.php

示例6: update

 public function update($id, Requests\TableRequest $request)
 {
     $table = Table::findOrFail($id);
     $table->update($request->all());
     \Session::flash('flash_message', 'Your Data has been Edited !!!');
     return redirect('table');
 }
开发者ID:shinichi81,项目名称:Laravel5-CRUD,代码行数:7,代码来源:TableController.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $movie = Movies::findOrFail($id);
     $movie->delete();
     \Session::flash('message', 'Movie "' . $movie->Title . '" has been Deleted');
     return redirect()->route('movies.index');
 }
开发者ID:nmetaute,项目名称:cinema,代码行数:13,代码来源:MoviesController.php

示例8: postUploadpic

 public function postUploadpic()
 {
     // getting all of the post data
     $id = \Auth::user()->id;
     $file = array('image' => \Input::file('image'));
     // setting up rules
     $rules = array('image' => 'required');
     //mimes:jpeg,bmp,png and for max size max:10000
     // doing the validation, passing post data, rules and the messages
     $validator = \Validator::make($file, $rules);
     if ($validator->fails()) {
         // send back to the page with the input data and errors
         return \Redirect::back();
     } else {
         // checking file is valid.
         if (\Input::file('image')->isValid()) {
             $destinationPath = 'assets/img';
             // upload path
             $extension = \Input::file('image')->getClientOriginalExtension();
             // getting image extension
             $fileName = $id . ".jpg";
             \Input::file('image')->move($destinationPath, $fileName);
             // uploading file to given path
             // sending back with message
             \DB::table('users')->where('id', $id)->update(array('uploadedpic' => 1));
             return \Redirect::back();
         } else {
             // sending back with error message.
             Session::flash('error', 'uploaded file is not valid');
             return \Redirect::back();
         }
     }
 }
开发者ID:must-classrecord,项目名称:must-classrecord.github.io,代码行数:33,代码来源:MainController.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(StoreGastoRequest $request)
 {
     $input = $request->all();
     $gasto = new Gasto($input);
     $exito = false;
     if ($input['prestamo'] == 'Ninguno') {
         $gasto->prestamo_user_id = NULL;
         if ($gasto->save()) {
             $exito = true;
         }
     } elseif ($input['prestamo'] == 'Prestamo') {
         $gasto->prestamo_user_id = $input['user_id'];
         $gasto->user_id = $input['prestamo_user_id'];
         if ($gasto->save()) {
             $exito = true;
         }
     } elseif ($input['prestamo'] == 'Gasto Compartido') {
         if ($this->createGastoCompartido($input)) {
             $exito = true;
         }
     }
     if ($exito) {
         \Session::flash('flash_message', "¡Se guardó chido! :)");
         return redirect('gastos');
     }
 }
开发者ID:el-cultivo,项目名称:consumo,代码行数:32,代码来源:GastosController.php

示例10: store

 public function store(CreateArticel $request)
 {
     $article = new \App\Articel($request->all());
     \Auth::user()->articles()->save($article);
     \Session::flash('flash_message', 'Your article has been created');
     return redirect('articles');
 }
开发者ID:natigiat,项目名称:learn,代码行数:7,代码来源:ArticlesController.php

示例11: destroy

 public function destroy($id)
 {
     $group = \App\Group::FindOrFail($id);
     $group->delete();
     \Session::flash('flash_message', 'Group has been deleted.');
     return redirect('groups');
 }
开发者ID:romulodl,项目名称:swim,代码行数:7,代码来源:GroupController.php

示例12: destroy

 public function destroy($id)
 {
     $task = Task::findOrFail($id);
     $task->delete();
     \Session::flash('flash_message', 'Tarea borrada');
     return redirect()->route('tasks.index');
 }
开发者ID:JuanVqz,项目名称:crud5,代码行数:7,代码来源:TasksController.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $category = new Category();
     $category->category_name = $request->category_name;
     $category->save();
     \Session::flash('success', 'Category created successfully');
 }
开发者ID:pius-ng3a,项目名称:go_orderdeliver,代码行数:13,代码来源:CategoryController.php

示例14: postDelete

 /**
  * 記事の削除
  */
 public function postDelete($id)
 {
     $article = $this->article->find($id);
     $article->delete();
     \Session::flash('flash_message', '記事を削除しました。');
     return redirect()->to('articles/index');
 }
开发者ID:haruya,项目名称:l5blog,代码行数:10,代码来源:ArticlesController.php

示例15: store

 /**
  * Store a newly created resource in storage.
  *
  * @param Deposit $deposit
  * @param  \Illuminate\Http\Request $request
  * @return \Illuminate\Http\Response
  */
 public function store(Deposit $deposit, Request $request)
 {
     if ((int) $request->input('amount') > Auth::user()->balance) {
         \Session::flash('message', 'Недостаточно средств!');
         return redirect('/profile');
     } elseif ($request->input('amount') <= 0) {
         \Session::flash('message', 'Введите корректную сумму!');
         return back();
     } else {
         $bank = Banks::where('banks_profiles_id', 2)->first();
         $data = $request->all();
         $data['days'] = $request->input('days');
         $data['percent'] = $request->input('percent');
         $data['conclusion'] = Carbon::now()->addDays((int) $request->input('days'));
         $user = User::find($request->input('user_id'));
         $plan = Plan::find($request->input('currency_id'));
         $deposit->fill($data);
         $deposit->user()->associate($user);
         $deposit->plan()->associate($plan);
         $bank->amount += (int) $request->input('amount');
         $bank->update();
         $user->balance -= (int) $request->input('amount');
         $user->update();
         $deposit->save();
         \Session::flash('message', 'Вы успешно сделали вклад! Для получения информации по вкладам перейдите в "Мои операции"');
         return redirect('/profile');
     }
 }
开发者ID:lyovkin,项目名称:elcoinbank,代码行数:35,代码来源:RequestMoneyController.php


注:本文中的App\Http\Controllers\Session::flash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。