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
f9c3754d
Commit
f9c3754d
authored
Sep 23, 2014
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More work on filters.
parent
34ee58ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
GuestFilter.php
app/Http/Filters/GuestFilter.php
+47
-0
No files found.
app/Http/Filters/GuestFilter.php
0 → 100644
View file @
f9c3754d
<?php
namespace
App\Http\Filters
;
use
Illuminate\Contracts\Routing\ResponseFactory
;
class
GuestFilter
{
/**
* The authenticator implementation.
*
* @var Authenticator
*/
protected
$auth
;
/**
* The response factory implementation.
*
* @var ResponseFactory
*/
protected
$response
;
/**
* Create a new filter instance.
*
* @param Authenticator $auth
* @return void
*/
public
function
__construct
(
Authenticator
$auth
,
ResponseFacotry
$response
)
{
$this
->
auth
=
$auth
;
$this
->
response
=
$response
;
}
/**
* Run the request filter.
*
* @return mixed
*/
public
function
filter
()
{
if
(
$this
->
auth
->
check
())
{
return
$this
->
response
->
redirectTo
(
'/'
);
}
}
}
\ 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