Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Yashvant Singh
/
laravel--
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Alexey Mezenin
2021-11-05 21:31:48 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d51e6a2ec21a357082168c55b73367084925237f
d51e6a2e
1 parent
aa45dfbc
Removed register method
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
6 deletions
app/Http/Controllers/UserController.php
app/Models/User.php
app/Http/Controllers/UserController.php
View file @
d51e6a2
...
...
@@ -24,7 +24,7 @@ class UserController extends Controller
public
function
store
(
StoreRequest
$request
)
:
array
{
$user
=
$this
->
user
->
register
(
$request
->
validated
()[
'user'
]);
$user
=
$this
->
user
->
create
(
$request
->
validated
()[
'user'
]);
auth
()
->
login
(
$user
);
...
...
app/Models/User.php
View file @
d51e6a2
...
...
@@ -41,11 +41,6 @@ class User extends Authenticatable implements JWTSubject
return
$this
->
belongsToMany
(
User
::
class
,
'followers'
,
'follower_id'
,
'following_id'
);
}
public
function
register
(
array
$userRequestData
)
:
self
{
return
$this
->
create
(
$userRequestData
);
}
public
function
doesUserFollowAnotherUser
(
int
$followerId
,
int
$followingId
)
:
bool
{
return
$this
->
where
(
'id'
,
$followerId
)
->
whereRelation
(
'following'
,
'id'
,
$followingId
)
->
exists
();
...
...
Please
register
or
login
to post a comment