julien-r44/laravel-boilerplate-api

该软件包已被废弃且不再维护。未建议替代软件包。

一个Laravel API模板。


README

基于

需求

您必须安装docker和composer。

设置

默认情况下,模板使用PostgreSQL作为关系数据库管理系统和Nginx,但您可以将其更改为任何您想要的。请参阅laradock文档以启动所需的容器。此设置文档假设您将使用PostgreSQL和Nginx。

# Create project from this repository
composer create-project julien-r44/laravel-boilerplate-api myProjectName -s dev
cd myProjectName

# Set the .env file of Laradock. You can customize it for matching your needs.
cp laradock/env-example laradock/.env

# If you run docker on windows check this issue related to postgres container and update your docker-compose.yml https://github.com/laradock/laradock/issues/1188

# Run Nginx, Redis, Postgres and Pgadmin containers
composer dockerize

# Set .env file of laradock project. You may have to edit it according to your needs.
cp .env.example .env

# Access the laradock workspace to run artisan's commands
docker exec -it laradock_workspace_1 bash

# Generate secret keys
php artisan key:generate
php artisan jwt:secret

# Migrate the database
php artisan migrate:fresh --seed

您也可以通过在浏览器中输入 localhost:5050 来访问PgAdmin,并使用以下默认凭据登录(定义在laradock/.env中)

Telescope默认在 localhost/telescope 中可用。Telescope配置为仅在本地环境中可用。

默认情况下,用户表配置为使用UUID作为主键。

将其发布到您的Git仓库

git init
git add *
git remote add origin https://github.com/yourName/yourProject
git push -u origin master