I have a form to add a comment, everything works fine, except for getting the ip who sent the comment
Here is my controller
public function sendComment(Request $request)
{
$articleComment = new ArticleComment;
$articleComment->name = $request->get('name');
$articleComment->email = $request->get('email');
$articleComment->text = $request->get('text');
$article = Article::find($request->get('article_id'));
$articleComment->user_ip = $request->ip();
$article->article_comments()->save($articleComment);
return back();
}
To get ip, I use $request->ip()
but in the end this value comes to my field "user_ip": "::1"
Maybe this is because I am testing everything on a local server, or what is the problem?