Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
c432b7f5
Commit
c432b7f5
authored
Nov 23, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Redirect->with_errors method.
parent
bbc8a5d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
redirect.php
laravel/redirect.php
+19
-1
No files found.
laravel/redirect.php
View file @
c432b7f5
...
@@ -90,6 +90,24 @@ class Redirect extends Response {
...
@@ -90,6 +90,24 @@ class Redirect extends Response {
return
$this
;
return
$this
;
}
}
/**
* Flash a Validator's errors to the session data.
*
* This method allows you to conveniently pass validation errors back to views.
*
* <code>
* // Redirect and flash a validator's errors the session
* return Redirect::to('register')->with_errors($validator);
* </code>
*
* @param Validator $validator
* @return Redirect
*/
public
function
with_errors
(
Validator
$validator
)
{
return
$this
->
with
(
'errors'
,
$validator
->
errors
);
}
/**
/**
* Magic Method to handle creation of redirects to named routes.
* Magic Method to handle creation of redirects to named routes.
*
*
...
@@ -126,4 +144,4 @@ class Redirect extends Response {
...
@@ -126,4 +144,4 @@ class Redirect extends Response {
throw
new
\BadMethodCallException
(
"Method [
$method
] is not defined on the Redirect class."
);
throw
new
\BadMethodCallException
(
"Method [
$method
] is not defined on the Redirect class."
);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment