本文整理汇总了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');
}
示例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');
}
示例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();
}
}
示例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');
*/
}
示例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');
}
示例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');
}
示例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');
}
示例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();
}
}
}
示例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');
}
}
示例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');
}
示例11: destroy
public function destroy($id)
{
$group = \App\Group::FindOrFail($id);
$group->delete();
\Session::flash('flash_message', 'Group has been deleted.');
return redirect('groups');
}
示例12: destroy
public function destroy($id)
{
$task = Task::findOrFail($id);
$task->delete();
\Session::flash('flash_message', 'Tarea borrada');
return redirect()->route('tasks.index');
}
示例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');
}
示例14: postDelete
/**
* 記事の削除
*/
public function postDelete($id)
{
$article = $this->article->find($id);
$article->delete();
\Session::flash('flash_message', '記事を削除しました。');
return redirect()->to('articles/index');
}
示例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');
}
}