An open API service indexing awesome lists of open source software.

https://github.com/tareq1988/lumen-starter

Lumen framework starter app
https://github.com/tareq1988/lumen-starter

authentication laravel lumen-framework

Last synced: about 1 year ago
JSON representation

Lumen framework starter app

Awesome Lists containing this project

README

          

# Lumen Starter

A starter package to use it with [Vue Lumen Starter](https://github.com/tareq1988/vue-lumen-starter).

## Packages Added

* [laravel-cors](https://github.com/barryvdh/laravel-cors)
* [spatie/laravel-fractal](https://github.com/spatie/laravel-fractal)

## Installation

1. Clone the repository: `git clone https://github.com/tareq1988/lumen-starter.git`
1. Copy `.env.example` as `.env` file and set the Database credentials
1. Set approprite `APP_URL`. In case using with [Vue Lumen Starter](https://github.com/tareq1988/vue-lumen-starter), set it to the Vue App URL.
1. Install Dependencies: `composer install`
1. Run migration: `php artisan migrate`
1. Run Seeder: `php artisan db:seed`

Done!

## REST API

### Authentication

View contents
Send Authorization bearer token to send authenticated request

```http
Authorization: bearer
```

### Register an User

View contents

`[POST /register]`

Params:

```
- `first_name` (string) - Users first name
- `last_name` (string) - The last name
- `email` (string) - The user email
- `password` (string) - The password
- `password_confirmation` (string) - The confirmation password
```

Response Code:
- ✅ 201: On registration success
- ❌ 422: On validation failure

### Login

View contents

`[POST /login]`

Params:

```
- `email` (string) - The user email
- `password` (string) - The password
```

Response Code:
- ✅ 200: On login success
- ❌ 401: On failure

### Fetch current user profile

View contents

`[GET /me]`

Response Code:
- ✅ 200: On success
- ❌ 401: On failure

### Update the current user profile

View contents

`[POST /me]`

Params:

```
- `first_name` (string) - Users first name
- `last_name` (string) - The last name
```

Response Code:
- ✅ 200: On login success
- ❌ 422: On validation failure

### Change the password

View contents

`[POST /me/password]`

Params:

```
- `current` (string) - The current password
- `password` (string) - New password
- `password_confirmation` (string) - The new confirmation password
```

Response Code:
- ✅ 200: On success
- ❌ 422: On validation failure

### Request Password Reset

View contents

`[POST /password/request]`

Params:

```
- `email` (string) - The email
```

Response Code:
- ✅ 200: On success
- ❌ 422: On validation failure

### Reset Password

View contents

`[POST /password/reset]`

Params:

```
- `email` (string) - The email
- `token` (string) - The forgot password token
- `password` (string) - New password
- `password_confirmation` (string) - The new confirmation password
```

Response Code:
- ✅ 200: On success
- ❌ 422: On validation failure

## Credits

[Tareq Hasan](https://tareq.co)