本文整理汇总了PHP中Illuminate\Routing\Redirector::route方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirector::route方法的具体用法?PHP Redirector::route怎么用?PHP Redirector::route使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Routing\Redirector
的用法示例。
在下文中一共展示了Redirector::route方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: requestUpdate
/**
* Update a Menu
*
* @param integer $id
* @param array $input
* @return Redirect
*/
public function requestUpdate($id, $input)
{
if ($this->Manager->updateMenu($id, $input)) {
return $this->Redirect->route('dvs-menus');
}
return $this->Redirect->route('dvs-menus-edit', $id)->withInput()->withErrors($this->Manager->errors)->with('message', $this->Manager->message);
}
示例2: getDelete
public function getDelete(Post $ad)
{
if ($ad) {
$ad->delete();
}
return $this->redirector->route('ad.list');
}
示例3: requestDestroyPage
/**
* Request the page be deleted from database
*
* @param integer $id
* @return Redirector
*/
public function requestDestroyPage($id)
{
$page = $this->ApiPagesManager->destroyPage($id);
if ($page) {
return $this->Redirect->route('dvs-api')->with('message', 'Request successfully removed');
}
return $this->Redirect->route('dvs-api')->withInput()->withErrors($this->ApiPagesManager->errors)->with('message', $this->ApiPagesManager->message);
}
示例4: filter
/**
* Execute the route filter.
*
* @param \Illuminate\Routing\Route $route
*
* @return void|\Illuminate\Http\RedirectResponse
*/
public function filter($route)
{
$slug = $this->getSlug($route);
$userId = $this->getUserId();
if (!$this->isTrickOwnedByUser($slug, $userId)) {
return $this->redirect->route('browse.recent');
}
}
示例5: postEdit
public function postEdit(Slider $slider)
{
$slider->title = $this->request->get('title');
$slider->description = $this->request->get('description');
$slider->featured_image = $this->request->get('featured_image');
$slider->save();
return $this->redirector->route('slider.edit', ['id' => $slider->id]);
}
示例6: postEdit
public function postEdit(Category $cat)
{
$cat->title = $this->request->get('title');
$cat->parent_id = $this->request->get('parent_id');
$cat->language = $this->request->get('language');
$cat->save();
return $this->redirector->route('cat.getEdit', ['id' => $cat->id]);
}
示例7: postEdit
public function postEdit(Post $Page)
{
$Page->subject = $this->request->get('subject');
$Page->permalink = $this->request->get('permalink');
$Page->content = $this->request->get('content');
$Page->save();
return $this->redirector->route('page.list', ['id' => $Page->id]);
}
示例8: requestCreateNewModel
/**
* Request a new page be created
*
* @param array $input
* @return Redirector
*/
public function requestCreateNewModel($input)
{
$scaffolding = $this->ScaffoldingManager->makeScaffolding($input, $this->CrudScaffolding);
if ($scaffolding) {
return $this->Redirect->route('dvs-dashboard');
}
return $this->Redirect->route('dvs-models-create')->withInput()->withErrors($this->ScaffoldingManager->errors)->with('message', $this->ScaffoldingManager->message);
}
示例9: store
public function store()
{
$validator = $this->validationFactory->make($this->request->except('_token', 'submit'), $this->rules['create']);
if ($validator->fails()) {
return $this->redirector->back()->withInput()->withErrors($validator);
}
$this->clients->create($this->request->get('name'), $this->request->get('redirect_uri'), (array) $this->request->get('grants'), (array) $this->request->get('scopes'));
return $this->redirector->route('oauth.clients.index')->with('success', "Client added successfully.");
}
示例10: handle
/**
* Execute the route filter.
*
* @param \Illuminate\Routing\Route $route
*
* @return void|\Illuminate\Http\RedirectResponse
*/
public function handle($request, Closure $next)
{
$slug = $this->getSlug($request->route());
$userId = $this->getUserId();
if (!$this->isTrickOwnedByUser($slug, $userId)) {
return $this->redirect->route('browse.recent');
}
return $next($request);
}
示例11: store
/**
* Store the scope
*
* @return \Illuminate\Http\RedirectResponse
*/
public function store()
{
$validator = $this->validationFactory->make($this->request->except('_token', 'submit'), $this->rules['create']);
if ($validator->fails()) {
return $this->redirector->back()->withInput()->withErrors($validator);
}
$this->scopes->create($this->request->get('id'), $this->request->get('description'));
return $this->redirector->route('oauth.scopes.index')->with('success', "Scope added successfully.");
}
示例12: index
/**
* @return \Illuminate\Contracts\View\View|\Illuminate\Http\RedirectResponse
*/
public function index()
{
$gamertag = $this->request->get('gamertag');
if ($gamertag) {
$result = destiny()->player($gamertag);
if ($result->count() == 1) {
return $this->redirect->to($result->first()->url);
} elseif ($result->count() > 1) {
return $this->redirect->route('select', ['gamertag' => $gamertag]);
}
return $this->view->make('search', ['gamertag' => $gamertag, 'result' => $result]);
}
return $this->view->make('index', ['advisors' => destiny()->advisors()]);
}
示例13: store
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return Response
*/
public function store(Request $request, Redirector $redirect)
{
//
$this->guardarDatos($request, null);
Session::flash('message', 'El idioma se ha creado correctamente');
return $redirect->route("languages.index");
}
示例14: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, \Closure $next)
{
// Check if the user is logged in
if (!$this->auth->check()) {
// Store the current uri in the session
$this->session->put('url.intended', $this->request->url());
// Redirect to the login page
return $this->redirect->route('login');
}
// Check if the user has access to the dashboard page
if (!$this->auth->hasAccess('dashboard.index')) {
// Show the insufficient permissions page
return $this->application->abort(403);
}
return $next($request);
}
示例15: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request, Redirector $redirect)
{
$rules = array('first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email|unique:users,email', 'password' => 'required|size:6', 'type' => 'required|in:user,admin');
$this->validate($request, $rules);
$user = User::create($request->all());
return $redirect->route('admin.users.index');
}