In this tutorial, I am using Laravel 5.3, which is the latest stable version at this time of writing. This tutorial assumes you already have a Laravel application running and the Composer tool is installed in your system and added to your system PATH. The API simply provides endpoints for creating user records, showing user record,s and generating a random password. In this tutorial, we would be creating a simple REST API service. For a complete documentation and usage guide of the Keygen package, see the README document at Github. This tutorial provides a quick guide on how you can get started with the Keygen package and using it in your Laravel applications. Key Mutations: You can control manipulations and mutations of multiple Keygen instances.Key Transformations: You can process the randomly generated string through a queue of callables before it is finally outputted.Seamless key affixes: It’s very easy to add a prefix or suffix to the randomly generated string.Here are some added benefits of the Keygen package: The Keygen package can save you some time trying to implement a custom random generation mechanism for your application.
It has a very simple interface and supports method chaining - making it possible to generate simple random keys with just one line of code. Keygen is a PHP package for generating simple random character sequences of any desired length and it ships with four generators, namely: numeric, alphanumeric, token, and bytes. When your application is required to generate very simple random character sequences like those enumerated above, then the Keygen package is a good option to go for.
Generating random strings as password salts to hash user passwords.Generating random base64-encoded tokens or strings as API keys.Password generation service that generates random alphanumeric password strings.