Laravel chat channel authentication without full user instance

- 1 answer

Ad

Authentication: I want to build a anonymous chat which people with the channelname and password can access.

Remember instance: When they enter the correct channel/pass-combination, they will be assigned a random username. Their messages will be linked to this username.

The only way I know how to authenticate people is through the user instance, but for convenience and anonimity I don't want people to create a whole account. I wish to use the User class for people to create new chat channels with.

So the architecture is like this:

User hasMany Chat hasMany AnonUser hasMany Message

Can someone explain how to authenticate anonymous users through a channel/pass-combination?

Ad

Answer

Ad

you did not mention your version of Laravel.. in case you did I would send you a sample code, but anyway here is the link to the most recent version's documentation: https://laravel.com/docs/5.2/authentication

you can find all the neccassary information there.

best

Ad
source: stackoverflow.com
Ad