cp .env.example .env
And fill the variables with your own data
composer install
Start the server
php -S localhost:8000 -t public
GET /login
: Requeries a username and password and returns a JWT token
- /prodcuts
each route has the following methods:
Index
: GET /routeShow
: GET /route/{id}Store
: POST /routeUpdate
: PUT /route/{id}Destroy
: DELETE /route/{id}
- Go to the login route
http://localhost:8000/login
- In postman go to Body -> raw -> JSON and send a GET request with the following body
{
"username": "string",
"password": "string"
}
{
"user": {
"id": 1,
"username": "Beverly Lindgren",
"email": "kschmitt@yahoo.com",
"role": "admin"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI3amE1ckoyOEt4bVcxMUtmQUNCSDBaRjlYRXY3ckFadEFIaXFoUERYTk4wPSIsImlhdCI6MTY5NDcxOTY2NiwibmJmIjoxNjk0NzE5NjY2LCJleHAiOjE2OTQ3MjMyNjYsImRhdGEiOnsiaWQiOjEsInVzZXJuYW1lIjoiQmV2ZXJseSBMaW5kZ3JlbiIsImVtYWlsIjoia3NjaG1pdHRAeWFob28uY29tIiwicm9sZSI6ImFkbWluIn19.7OnUs8t4d2DUT6kSM7kPfJC7wG5DnE92tsddUvXHCbs"
}
Only the frist time deploying the app at Raiway.app
NIXPACKS_BUILD_CMD=composer install && php artisan migrate --force && php artisan db:seed --force
composer create-project --prefer-dist laravel/lumen [project-name]
php artisan make:migration create_users_table
php artisan migrate
php artisan migrate:fresh
php artisan db:seed nameOfTheSeeder
php artisan db:seed
php artisan make:seeder nameTableSeeder
Note: the name of the seeder must be the name of the table in singular and start with capital letter
php artisan make:model Topic
Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.
Documentation for the framework can be found on the Lumen website.
Thank you for considering contributing to Lumen! The contribution guide can be found in the Laravel documentation.
If you discover a security vulnerability within Lumen, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.
The Lumen framework is open-sourced software licensed under the MIT license.