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
076d86bf
Commit
076d86bf
authored
Sep 23, 2014
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplifying some filters.
parent
986c964c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
23 deletions
+6
-23
GuestFilter.php
app/Http/Filters/GuestFilter.php
+3
-12
MaintenanceFilter.php
app/Http/Filters/MaintenanceFilter.php
+3
-11
No files found.
app/Http/Filters/GuestFilter.php
View file @
076d86bf
<?php
namespace
App\Http\Filters
;
<?php
namespace
App\Http\Filters
;
use
Illuminate\
Contracts\Routing\ResponseFactory
;
use
Illuminate\
Http\RedirectResponse
;
class
GuestFilter
{
class
GuestFilter
{
...
@@ -11,24 +11,15 @@ class GuestFilter {
...
@@ -11,24 +11,15 @@ class GuestFilter {
*/
*/
protected
$auth
;
protected
$auth
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
/**
* Create a new filter instance.
* Create a new filter instance.
*
*
* @param Authenticator $auth
* @param Authenticator $auth
* @return void
* @return void
*/
*/
public
function
__construct
(
Authenticator
$auth
,
public
function
__construct
(
Authenticator
$auth
)
ResponseFacotry
$response
)
{
{
$this
->
auth
=
$auth
;
$this
->
auth
=
$auth
;
$this
->
response
=
$response
;
}
}
/**
/**
...
@@ -40,7 +31,7 @@ class GuestFilter {
...
@@ -40,7 +31,7 @@ class GuestFilter {
{
{
if
(
$this
->
auth
->
check
())
if
(
$this
->
auth
->
check
())
{
{
return
$this
->
response
->
redirectTo
(
'/'
);
return
new
RedirectResponse
(
url
(
'/'
)
);
}
}
}
}
...
...
app/Http/Filters/MaintenanceFilter.php
View file @
076d86bf
<?php
namespace
App\Http\Filters
;
<?php
namespace
App\Http\Filters
;
use
Illuminate\Http\Response
;
use
Illuminate\Contracts\Foundation\Application
;
use
Illuminate\Contracts\Foundation\Application
;
use
Illuminate\Contracts\Routing\ResponseFactory
;
class
MaintenanceFilter
{
class
MaintenanceFilter
{
...
@@ -12,23 +12,15 @@ class MaintenanceFilter {
...
@@ -12,23 +12,15 @@ class MaintenanceFilter {
*/
*/
protected
$app
;
protected
$app
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
/**
* Create a new filter instance.
* Create a new filter instance.
*
*
* @param Application $app
* @param Application $app
* @return void
* @return void
*/
*/
public
function
__construct
(
Application
$app
,
ResponseFactory
$response
)
public
function
__construct
(
Application
$app
)
{
{
$this
->
app
=
$app
;
$this
->
app
=
$app
;
$this
->
response
=
$response
;
}
}
/**
/**
...
@@ -40,7 +32,7 @@ class MaintenanceFilter {
...
@@ -40,7 +32,7 @@ class MaintenanceFilter {
{
{
if
(
$this
->
app
->
isDownForMaintenance
())
if
(
$this
->
app
->
isDownForMaintenance
())
{
{
return
$this
->
response
->
mak
e
(
'Be right back!'
,
503
);
return
new
Respons
e
(
'Be right back!'
,
503
);
}
}
}
}
...
...
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