Comments (3)
@Redtama when it converts the case it does use the Laravel string helper so you should be able to set the case to 'studly'
which I believe is the equivalent of pascal case.
As long as there is a space between the two words, using 'studly'
does convert correctly as 'HappyBiographer'
. However if it's passed as 'happybiographer'
then it will end up being 'Happybiographer'
For example
UsernameGenerator::setConfig(['case' => 'studly'])->generate('happy biographer');
// Returns 'HappyBiographer'
UsernameGenerator::setConfig(['case' => 'studly'])->generate('happybiographer');
// Returns 'Happybiographer'
UsernameGenerator::setConfig(['case' => 'studly'])->generate();
// Returns a random name with the correct casing like 'HappyBiographer'
from laravel-username-generator.
@samueljtaylor That is super helpful thank you! I had never heard the term "studly" but after a bit of googling it does seem to be basically just another term for pascal case.
I've tried it and it works great 👍🏻.
"it does use the Laravel string helper" - it may help others if this was added to the documentation. If it already is and I just missed it then I apologise! Thanks again for your help and providing a great tool!
from laravel-username-generator.
Okay perfect, glad to hear it! I've added it just recently to the readme but I'll make it a bit more clear.
from laravel-username-generator.
Related Issues (20)
- No work in Laravel 5.6 HOT 1
- Login with username HOT 1
- How to force the length of user name HOT 2
- custom generatorConfig does not override GeneratesUsernames trait HOT 3
- Unique possibly fails HOT 1
- Ability to create username using a word dictionary HOT 1
- Bug impossible to get a username HOT 9
- How do I use this package if my User model doesn't have name column ? HOT 5
- vendor:publish fails HOT 1
- Max length username HOT 4
- Not working with cyrillic strings HOT 8
- Assignment error HOT 1
- Not respecting nouns/adjectives in config HOT 2
- How to get list of usernames available? HOT 5
- Class '\App\User' not found HOT 2
- Possible SQL-Injection? HOT 1
- generated usernames is same!
- Username suggester HOT 1
- Sugestion HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-username-generator.