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
b8f3dd62
Commit
b8f3dd62
authored
Oct 06, 2014
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on middle wares.
parent
43e8c60a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
11 deletions
+28
-11
AuthMiddleware.php
app/Http/Middleware/AuthMiddleware.php
+2
-2
BasicAuthMiddleware.php
app/Http/Middleware/BasicAuthMiddleware.php
+2
-2
CsrfMiddleware.php
app/Http/Middleware/CsrfMiddleware.php
+3
-3
GuestMiddleware.php
app/Http/Middleware/GuestMiddleware.php
+2
-2
MaintenanceMiddleware.php
app/Http/Middleware/MaintenanceMiddleware.php
+2
-2
AppServiceProvider.php
app/Providers/AppServiceProvider.php
+17
-0
No files found.
app/Http/Middleware/AuthMiddleware.php
View file @
b8f3dd62
...
@@ -39,9 +39,9 @@ class AuthMiddleware implements Middleware {
...
@@ -39,9 +39,9 @@ class AuthMiddleware implements Middleware {
/**
/**
* Handle an incoming request.
* Handle an incoming request.
*
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
*/
public
function
handle
(
$request
,
Closure
$next
)
public
function
handle
(
$request
,
Closure
$next
)
{
{
...
...
app/Http/Middleware/BasicAuthMiddleware.php
View file @
b8f3dd62
...
@@ -27,9 +27,9 @@ class BasicAuthMiddleware implements Middleware {
...
@@ -27,9 +27,9 @@ class BasicAuthMiddleware implements Middleware {
/**
/**
* Handle an incoming request.
* Handle an incoming request.
*
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
*/
public
function
handle
(
$request
,
Closure
$next
)
public
function
handle
(
$request
,
Closure
$next
)
{
{
...
...
app/Http/Middleware/CsrfMiddleware.php
View file @
b8f3dd62
...
@@ -9,13 +9,13 @@ class CsrfMiddleware implements Middleware {
...
@@ -9,13 +9,13 @@ class CsrfMiddleware implements Middleware {
/**
/**
* Handle an incoming request.
* Handle an incoming request.
*
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
*/
public
function
handle
(
$request
,
Closure
$next
)
public
function
handle
(
$request
,
Closure
$next
)
{
{
if
(
$request
->
getS
ession
()
->
token
()
!=
$request
->
input
(
'_token'
))
if
(
$request
->
s
ession
()
->
token
()
!=
$request
->
input
(
'_token'
))
{
{
throw
new
TokenMismatchException
;
throw
new
TokenMismatchException
;
}
}
...
...
app/Http/Middleware/GuestMiddleware.php
View file @
b8f3dd62
...
@@ -28,9 +28,9 @@ class GuestMiddleware implements Middleware {
...
@@ -28,9 +28,9 @@ class GuestMiddleware implements Middleware {
/**
/**
* Handle an incoming request.
* Handle an incoming request.
*
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
*/
public
function
handle
(
$request
,
Closure
$next
)
public
function
handle
(
$request
,
Closure
$next
)
{
{
...
...
app/Http/Middleware/MaintenanceMiddleware.php
View file @
b8f3dd62
...
@@ -28,9 +28,9 @@ class MaintenanceMiddleware {
...
@@ -28,9 +28,9 @@ class MaintenanceMiddleware {
/**
/**
* Handle an incoming request.
* Handle an incoming request.
*
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
*/
public
function
handle
(
$request
,
Closure
$next
)
public
function
handle
(
$request
,
Closure
$next
)
{
{
...
...
app/Providers/AppServiceProvider.php
View file @
b8f3dd62
...
@@ -31,4 +31,21 @@ class AppServiceProvider extends ServiceProvider {
...
@@ -31,4 +31,21 @@ class AppServiceProvider extends ServiceProvider {
'Illuminate\Session\Middleware\Writer'
,
'Illuminate\Session\Middleware\Writer'
,
];
];
/**
* Build the application stack based on the provider properties.
*
* @return void
*/
public
function
stack
()
{
$this
->
app
->
stack
(
function
(
Stack
$stack
,
Router
$router
)
{
return
$stack
->
middleware
(
$this
->
stack
)
->
then
(
function
(
$request
)
use
(
$router
)
{
return
$router
->
dispatch
(
$request
);
});
});
}
}
}
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