clarkeash / doorman

Limit access to your Laravel applications by using invite codes
https://packagist.org/packages/clarkeash/doorman
MIT License
1.02k stars 45 forks source link

make() not to return a collection for 1 code #56

Closed leenooks closed 4 years ago

leenooks commented 4 years ago

Howdy,

Would you consider having make() not return a collection when only 1 code is created?

IE: It would be nice to be able to use ...->make()->code directly, instead of having to go ->make()->first()->code especially when only code will be made (for an email address for example).

clarkeash commented 4 years ago

Hi, I wouldnt really want to change make so that it had potentially different return types. But I would be happy to add a different method e.g.

Doorman::generate()->for('user@example.com')->once();

Which would only create one invite and return that.

clarkeash commented 4 years ago

v5.1.0 has been released with this change https://github.com/clarkeash/doorman/releases/tag/v5.1.0