Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
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
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
11 deletions
+28
-11
app/Http/Middleware/AuthMiddleware.php
+2
-2
app/Http/Middleware/BasicAuthMiddleware.php
+2
-2
app/Http/Middleware/CsrfMiddleware.php
+3
-3
app/Http/Middleware/GuestMiddleware.php
+2
-2
app/Http/Middleware/MaintenanceMiddleware.php
+2
-2
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 {
/**
* Handle an incoming request.
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
{
...
...
app/Http/Middleware/BasicAuthMiddleware.php
View file @
b8f3dd62
...
...
@@ -27,9 +27,9 @@ class BasicAuthMiddleware implements Middleware {
/**
* Handle an incoming request.
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
{
...
...
app/Http/Middleware/CsrfMiddleware.php
View file @
b8f3dd62
...
...
@@ -9,13 +9,13 @@ class CsrfMiddleware implements Middleware {
/**
* Handle an incoming request.
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
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
;
}
...
...
app/Http/Middleware/GuestMiddleware.php
View file @
b8f3dd62
...
...
@@ -28,9 +28,9 @@ class GuestMiddleware implements Middleware {
/**
* Handle an incoming request.
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
{
...
...
app/Http/Middleware/MaintenanceMiddleware.php
View file @
b8f3dd62
...
...
@@ -28,9 +28,9 @@ class MaintenanceMiddleware {
/**
* Handle an incoming request.
*
* @param \
Symfony\Component\HttpFoundation
\Request $request
* @param \
Illuminate\Http
\Request $request
* @param \Closure $next
* @return
\Symfony\Component\HttpFoundation\Response
* @return
mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
{
...
...
app/Providers/AppServiceProvider.php
View file @
b8f3dd62
...
...
@@ -31,4 +31,21 @@ class AppServiceProvider extends ServiceProvider {
'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