本文整理汇总了PHP中Illuminate\Support\Facades\Redirect::route方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::route方法的具体用法?PHP Redirect::route怎么用?PHP Redirect::route使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Redirect
的用法示例。
在下文中一共展示了Redirect::route方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* @return mixed
*/
public function delete()
{
$bookId = Input::get('book_id');
$book = Book::find($bookId);
$book->delete();
return Redirect::route('books')->with('message', sprintf('Book "%s" deleted', $book->title));
}
示例2: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Requests\CreatePagoRequest $request)
{
$pago = Pagos::create($request->all());
$message = 'Pago efectuado de: ' . $pago->monto . ' al usuario: ' . $pago->user->first_name . ' ' . $pago->user->last_name;
Session::flash('message', $message);
return Redirect::route('admin.users.index');
}
示例3: search
/**
* search in Flickr API for a specific set of keywords
*
* @param SearchRequest $request
* @param int $id
* @return mixed
*/
public function search(SearchRequest $request, $id = 1)
{
$photoSearch = $request->all();
$query = $photoSearch['photoSearch'];
$data = $this->flickrRepository->search($query, $id);
return Redirect::route('search.page', [$query, $id])->with($data);
}
示例4: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(CreateTratamientoRequest $request)
{
$tratamiento = Tratamiento::create($request->all());
$message = $tratamiento->nombre_tratamiento . ' fue creado correctamente';
Session::flash('message', $message);
return Redirect::route('admin.tratamiento.index');
}
示例5: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, \Closure $next)
{
if ($this->auth->check()) {
return Redirect::route(config('asgard.user.users.redirect_route_after_login'));
}
return $next($request);
}
示例6: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
if (!subscribers_enabled()) {
return Redirect::route('status-page');
}
return $next($request);
}
示例7: remove
/**
* Remove post with given id
*
* @param $id
* @return mixed
*/
public function remove($id)
{
$post = $this->getRepository()->find($id);
EntityManager::remove($post);
EntityManager::flush();
return Redirect::route('post.list');
}
示例8: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//define rules
//$rules = array(
// 'name' => array('required', 'unique:todo_lists')
// );
// pass input to validator
//$validator = Validator::make(Input::all(), $rules);
// test if input fails
// if ($validator->fails()) {
// return Redirect::route('todos.create')->withErrors($validator)->withInput();
//}
$this->validate($request, ['name' => 'required|unique:posts|max:255']);
// pass input to validator
$validator = Validator::make(Input::all(), $this);
// test if input fails
if ($validator->fails()) {
$message = $validator->messages();
return $messages;
//return Redirect::route('todos.create')->withErrors($validator)->withInput();
}
$name = Input::get('name');
$list = new TodoList();
$list->name = $name;
$list->save();
return Redirect::route('todos.index')->withMessage('List Was Created!');
}
示例9: update
/**
* Update the specified resource in storage.
*
* @param int $id
*
* @return Response
*/
public function update($id = null)
{
$user = Auth::user();
$input = Input::only('location', 'website', 'bio', 'twitter', 'facebook', 'github', 'cover', 'image', 'notify_articles');
$user->profile()->update($input);
return Redirect::route('user-package::profile.show');
}
示例10: handle
/**
* We're verifying that subscribers is both enabled and configured.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle($request, Closure $next)
{
if (!subscribers_enabled()) {
return Redirect::route('explore');
}
return $next($request);
}
示例11: delete
/**
* @return mixed
*/
public function delete()
{
$userId = Input::get('user_id');
$user = User::find($userId);
$user->delete();
return Redirect::route('users')->with('message', sprintf('User "%s" deleted', $user->first_name));
}
示例12: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Requests\CreatePagos2Request $request)
{
$pago = new Pagos($request->all());
$usuario = User::findOrFail($pago->user_id);
if ($usuario->saldo > 0 && $pago->monto <= $usuario->saldo) {
$saldo = $usuario->saldo;
$saldo2 = $usuario->saldo = $saldo - $pago->monto;
DB::table('users')->where('id', $usuario->id)->update(['saldo' => $saldo2]);
$pago = Pagos::create($request->all());
$message = 'El Paciente ' . $usuario->first_name . ' ' . $usuario->last_name . ' pagó un total de: ' . '$' . number_format($pago->monto);
Session::flash('message', $message);
if (Auth::user()->type == 'admin') {
return Redirect::route('admin.pagar.index');
}
if (Auth::user()->type == 'secretaria') {
return Redirect::route('secretaria.pagar.index');
}
} else {
$message = $usuario->first_name . ' ' . $usuario->last_name . ' no registra deuda en el sistema o el monto de ' . '$' . number_format($pago->monto) . ' que se quiere pagar es superior al saldo: ' . '$' . number_format($usuario->saldo);
Session::flash('message', $message);
if (Auth::user()->type == 'admin') {
return Redirect::route('admin.pagar.index');
}
if (Auth::user()->type == 'secretaria') {
return Redirect::route('secretaria.pagar.index');
}
}
}
示例13: show
/**
* Display the specified resource.
*
* @param int $id
*/
public function show($id)
{
// if exist external content then send it to browser, increment views
$external_content = $this->showPage->checkAndGetContentFromHtmlFile(app('veer')->siteId, $id);
if (!empty($external_content)) {
\Veer\Models\Page::where('id', '=', $id)->increment('views');
return \Response::make($external_content, 200)->header('Content-type', 'text/html');
}
$page = $this->showPage->getPage($id, app('veer')->siteId);
if (!is_object($page)) {
return Redirect::route('page.index');
}
$page->increment('views');
$page->load(array('images' => function ($q) {
return $q->orderBy('pivot_id', 'asc');
}, 'tags', 'attributes', 'downloads', 'userlists', 'user'));
$page->imagesIds = collect($page->images->getDictionary());
if ($page->show_comments == 1) {
$this->showPage->loadComments($page, 'page');
}
$paginator_and_sorting = get_paginator_and_sorting();
$data = array("page" => $page, "subpages" => $this->showPage->withChildPages(app('veer')->siteId, $page->id, $paginator_and_sorting), "parentpages" => $this->showPage->withParentPages(app('veer')->siteId, $page->id, $paginator_and_sorting), "products" => $this->showPage->withProducts(app('veer')->siteId, $page->id, $paginator_and_sorting), "categories" => $this->showPage->withCategories(app('veer')->siteId, $page->id), "template" => $this->template);
$blade_path = $this->template . '.pages.' . $id;
$viewLink = $this->template . '.page';
// page with special design
if ($page->original == 1 && \View::exists($blade_path)) {
$viewLink = $blade_path;
}
$view = viewx($viewLink, $data);
$this->view = $view;
return $view;
}
示例14: store
public function store(ActorsRequest $request)
{
$actors = new Actors();
$actors->firstname = $request->nom;
$actors->lastname = $request->prenom;
$actors->dob = $request->dob;
$actors->nationality = $request->nationalite;
$actors->image = $request->image;
$filename = "";
if ($request->hasFile('image')) {
//je recupere mon fichier :
$file = $request->file('image');
//je recupere le nom du fichier :
$filename = $file->getClientOriginalName();
//je stock le chemin veers lequel mon image va etre envoyé
$destinationPath = public_path() . '/uploads/actors';
//je deplace mon fichier uploader :
$file->move($destinationPath, $filename);
}
$actors->image = asset("uploads/movies/" . $filename);
$actors->save();
Session::flash('success', "L\\'acteur {$actors->nom} a été ajouté");
return Redirect::route('actors_index');
//recupere le film de mon film ac la methode POST
//input (name de mon champ) permet de recuperer la donéne titre de maniere safely
}
示例15: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$property = Property::findOrFail($request->all()['property_id']);
$rental = ['id' => $request->all()['rental_id'], 'dailyAmount' => $request->all()['rental_dailyAmount'], 'from' => $request->all()['rental_from'], 'to' => $request->all()['rental_to'], 'media' => self::stripMedia($request)];
Rental::store($rental['dailyAmount'], $rental['from'], $rental['to'], $property, $rental['media'], $rental['id']);
return Redirect::route('rental.index');
}