Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sisage
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
Marcos Albano
sisage
Commits
e8f48ae8
Commit
e8f48ae8
authored
Jan 21, 2021
by
Marcos Albano
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adicionado relacionamentos dos Models Role e Permission com User
parent
782b6abf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
Role.php
app/Role.php
+8
-8
User.php
app/User.php
+4
-4
No files found.
app/Role.php
View file @
e8f48ae8
...
...
@@ -12,13 +12,13 @@ class Role extends Model
'name'
,
'description'
,
];
//
public function users()
//
{
//
return $this->belongsToMany(User::class, 'id');
//
}
public
function
users
()
{
return
$this
->
belongsToMany
(
User
::
class
,
'id'
);
}
//
public function permissions()
//
{
//
return $this->belongsToMany(Permission::class, 'id');
//
}
public
function
permissions
()
{
return
$this
->
belongsToMany
(
Permission
::
class
,
'id'
);
}
}
app/User.php
View file @
e8f48ae8
...
...
@@ -28,9 +28,9 @@ class User extends Authenticatable
'password'
,
'remember_token'
,
];
//
public function roles()
//
{
//
return $this->belongsToMany(Role::class, 'id');
//
}
public
function
roles
()
{
return
$this
->
belongsToMany
(
Role
::
class
,
'id'
);
}
}
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