Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
Platform
Commits
62efe73a
Commit
62efe73a
authored
Aug 31, 2017
by
Nicolas Widart
Committed by
GitHub
Aug 31, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #367 from MehediDracula/2.0
Bind current object to the dynamic relations closure
parents
33e556f1
cb33f8c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
User.php
Modules/User/Entities/Sentinel/User.php
+3
-2
config.php
config/asgard/user/config.php
+2
-2
No files found.
Modules/User/Entities/Sentinel/User.php
View file @
62efe73a
...
...
@@ -113,8 +113,9 @@ class User extends EloquentUser implements UserInterface, AuthenticatableContrac
#i: Relation method resolver
if
(
config
()
->
has
(
$config
))
{
$function
=
config
()
->
get
(
$config
);
$bound
=
$function
->
bindTo
(
$this
);
return
$
function
(
$this
);
return
$
bound
(
);
}
#i: No relation found, return the call to parent (Eloquent) to handle it.
...
...
config/asgard/user/config.php
View file @
62efe73a
...
...
@@ -85,8 +85,8 @@ return [
| Add relations that will be dynamically added to the User entity
*/
'relations'
=>
[
// 'extension' => function (
$self
) {
// return $
self
->belongsTo(UserExtension::class, 'user_id', 'id')->first();
// 'extension' => function () {
// return $
this
->belongsTo(UserExtension::class, 'user_id', 'id')->first();
// }
],
/*
...
...
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