I\'m trying to save a user ip address to my database using Laravel 4. I found the following function which returns a string
Request::getClientIp()
>
From @Unnawut.
You need to change from binary(16) to varbinary(16) if you want to deal with both ipv4 and ipv6 in the same field.
But if you need to deal only ip v4 just INT UNSIGNED
If you want to deal only ip v6 BINARY(16)
ref: MYSQL - SELECT IP v4/v6, inet_pton & bin2hex
ref2: https://stackoverflow.com/a/5133610/2126472