Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

binggle's avatar

How to make Unique User without Login ?

Hi.

I want to discriminate users even without login .

Maybe IP and browser would be used.

Can I get any information more about this case ?

0 likes
2 replies
fylzero's avatar
fylzero
Best Answer
Level 67

@binggle

This is just an approach off the top of my head...

Create a middleware like php artisan make:middleware LoginOrRegisterFromIpAddress

I would add ip_address to the user table migration.

Have the middleware grab the users ip request()->ip or whatever works.

Check the users table for that ip, if it exists, log the user in.

If it doesn't exist, create the user then log them in.

2 likes
newbie360's avatar

what about use proxy/vpn and use shared ip, different person use the same ip

also ISP provide dynamic IP

Please or to participate in this conversation.