Hii i want to store ip addresss in database in laravel 5.1.I have searched in google to store ip address and they suggest me to store ip address like Request::ip(); or other method $request->ip();.when i used this and keep this line as $request->ip(); then it print the ip address.But I have used array $data in auth controller during sign up.
protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'ip' => $data->ip(), ]); } the main problem is when i use this line as storing ip like this 'ip' => $data->ip(), it cause error
FatalErrorException in AuthController.php Call to a member function ip() on a non-object.The error is in this line 'ip' => $data->ip(). Can you please help me.
$data