https://github.com/gbrayhan/laravel-php-8
Boilerplate Laravel PHP8, using SQL, JWT, Swagger, Docker, Migrations.
https://github.com/gbrayhan/laravel-php-8
docker-compose jwt jwt-authentication laravel migrations mysql php-8 php8 swagger
Last synced: 3 months ago
JSON representation
Boilerplate Laravel PHP8, using SQL, JWT, Swagger, Docker, Migrations.
- Host: GitHub
- URL: https://github.com/gbrayhan/laravel-php-8
- Owner: gbrayhan
- Created: 2021-10-16T21:23:40.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T13:24:30.000Z (over 2 years ago)
- Last Synced: 2025-02-10T11:09:16.572Z (5 months ago)
- Topics: docker-compose, jwt, jwt-authentication, laravel, migrations, mysql, php-8, php8, swagger
- Language: PHP
- Homepage:
- Size: 1.85 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Boilerplate Laravel 8 and PHP 8
This repo is functionality complete — PRs and issues welcome!
----------
# Getting started
## Installation
Please check the official laravel installation guide for server requirements before you start. [Official Documentation](https://laravel.com/docs/5.4/installation#installation)
Alternative installation is possible without local dependencies relying on [Docker](#docker).
Clone the repository
git clone [email protected]:gbrayhan/laravel-php-8.git
Switch to the repo folder
cd laravel-php-8
Install all the dependencies using composer
composer install
Copy the example env file and make the required configuration changes in the .env file
cp .env.example .env
Generate a new application key
php artisan key:generate
Generate a new JWT authentication secret key
php artisan jwt:secret
Run the database migrations (**Set the database connection in .env before migrating**)
php artisan migrate
Start the local development server
php artisan serve
You can now access the server at http://localhost:8000
**TL;DR command list**
git clone [email protected]:gbrayhan/laravel-php-8.git
cd laravel-php-8
composer install
cp .env.example .env
php artisan key:generate
php artisan jwt:secret**Make sure you set the correct database connection information before running the migrations** [Environment variables](#environment-variables)
php artisan migrate
php artisan serve## Docker
To install with [Docker](https://www.docker.com), run following commands:
```
git clone [email protected]:gbrayhan/laravel-php-8.git
cd laravel-php-8
cp .env.example .env
docker-compose up -d
docker exec php_app php artisan key:generate
docker exec php_app php artisan jwt:secret
docker exec php_app php artisan migrate
```The api can be accessed at [http://localhost:8000/api](http://localhost:8000/api).
## API Specification
This application adheres to the api specifications set by the [Thinkster](https://github.com/gothinkster) team. This helps mix and match any backend with any other frontend without conflicts.
> [Full API Spec](https://github.com/gothinkster/realworld/tree/master/api)
More information regarding the project can be found here https://github.com/gothinkster/realworld
----------
# Code overview
## Dependencies
- [jwt-auth](https://github.com/tymondesigns/jwt-auth) - For authentication using JSON Web Tokens
- [darkaonline/l5-swagge](https://github.com/darkaonline/l5-swagge) - For API Documentation based on API SWAGGE## Environment variables
- `.env` - Environment variables can be set in this file
***Note*** : You can quickly set the database information and other variables in this file and have the application fully working.
----------
# AuthenticationThis applications uses JSON Web Token (JWT) to handle authentication. The token is passed with each request using the `Authorization` header with `Token` scheme. The JWT authentication middleware handles the validation and authentication of the token. Please check the following sources to learn more about JWT.
- https://jwt.io/introduction/
- https://self-issued.info/docs/draft-ietf-oauth-json-web-token.html----------