Alexey Mezenin

Removed register method

......@@ -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);
......
......@@ -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();
......