Laravel chat channel authentication without full user instance

- 1 answer


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?




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:

you can find all the neccassary information there.