Basic neoan.io Lenkrad starter kit with authentication
This is a very light project setup designed to get your REST-api up and running in no time.
- composer ^2
composer create-project neoan.io/rest-api-starter-project my-app
This project ships with a basic tutorial to get you started. For deeper understanding, please visit the lenkrad docs: neoan.io lenkrad
After installation, you can register a user against POST /api/auth/register (src/Auth/Api/Register.php) with a payload containing email and password:
Authenticated calls will require the provided JWT-token
The login endpoint is
/api/auth/authenticate (src/Auth/Api/Authenticate.php) and the endpoint
/api/auth/me (src/Auth/Api/Me.php) returns the current user.
Middleware can be chained prior to routes in the respective Attributes (see src/Auth/Api/ME.php for clarification)
The folder src/Example should give you a good starting point for intuitive understanding of how the LENKRAD core is used in this starter. Be aware that you are completely free regarding structure. What you find in this starter is a mere example.
- .env file update
- folder src/Example necessary?
- is only the folder /public exposed to the web?
First, add the following information to your .env file
Make sure that the selected database is created. Then, change the constructor of
config/Database.php to use the method
useMySql instead of
When migrating, use the dialect keyword
mysql instead of
php cli migrate:models mysql