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
9ec8f4a5
Commit
9ec8f4a5
authored
Jul 11, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Auth config to use closures.
parent
757e1280
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
auth.php
application/config/auth.php
+18
-10
No files found.
application/config/auth.php
View file @
9ec8f4a5
...
...
@@ -4,29 +4,37 @@ return array(
/*
|--------------------------------------------------------------------------
|
Authentication Model
|
Retrieve Users By ID
|--------------------------------------------------------------------------
|
| This m
odel will be used by the Auth class when retrieving the users of
|
your application. Feel free to change it to the name of your user model.
| This m
ethod is called by the Auth::user() method when attempting to load
|
a user by their user ID.
|
|
Note: The authentication model must be an Eloquent model
.
|
You are free to change this method for your application however you wish
.
|
*/
'model'
=>
'User'
,
'by_id'
=>
function
(
$id
)
{
return
User
::
find
(
$id
);
},
/*
|--------------------------------------------------------------------------
|
Authentication
Username
|
Retrieve Users By
Username
|--------------------------------------------------------------------------
|
| The authentication username is the column on your users table that
| is considered the username of the user. Typically, this is either "email"
| or "username". However, you are free to make it whatever you wish.
| This method is called by the Auth::check() method when attempting to load
| a user by their username.
|
| You are free to change this method for your application however you wish,
| as long as you return an object that has "id" and "password" properties.
|
*/
'username'
=>
'email'
,
'by_username'
=>
function
(
$username
)
{
return
User
::
where
(
'email'
,
'='
,
$username
)
->
first
();
},
);
\ 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