Skip to content

Commit 044b758

Browse files
committed
Initial commit
0 parents  commit 044b758

File tree

94 files changed

+13958
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+13958
-0
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[docker-compose.yml]
18+
indent_size = 4

.env.example

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
APP_NAME="Laravel API Boilerplate"
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_TIMEZONE=UTC
6+
APP_URL=http://localhost
7+
8+
APP_LOCALE=en
9+
APP_FALLBACK_LOCALE=en
10+
APP_FAKER_LOCALE=en_US
11+
12+
APP_MAINTENANCE_DRIVER=file
13+
# APP_MAINTENANCE_STORE=database
14+
15+
PHP_CLI_SERVER_WORKERS=4
16+
17+
BCRYPT_ROUNDS=12
18+
19+
LOG_CHANNEL=stack
20+
LOG_STACK=single
21+
LOG_DEPRECATIONS_CHANNEL=null
22+
LOG_LEVEL=debug
23+
24+
WWWUSER=1000
25+
WWWGROUP=1000
26+
27+
DB_CONNECTION=mariadb
28+
DB_HOST=mariadb
29+
DB_PORT=3306
30+
DB_DATABASE=laravel
31+
DB_USERNAME=development
32+
DB_PASSWORD=development
33+
34+
SESSION_DRIVER=database
35+
SESSION_LIFETIME=120
36+
SESSION_ENCRYPT=false
37+
SESSION_PATH=/
38+
SESSION_DOMAIN=null
39+
40+
BROADCAST_CONNECTION=log
41+
FILESYSTEM_DISK=local
42+
QUEUE_CONNECTION=database
43+
44+
CACHE_STORE=database
45+
CACHE_PREFIX=
46+
47+
MEMCACHED_HOST=127.0.0.1
48+
49+
REDIS_CLIENT=phpredis
50+
REDIS_HOST=redis
51+
REDIS_PASSWORD=null
52+
REDIS_PORT=6379
53+
54+
MAIL_MAILER=log
55+
MAIL_HOST=127.0.0.1
56+
MAIL_PORT=2525
57+
MAIL_USERNAME=null
58+
MAIL_PASSWORD=null
59+
MAIL_ENCRYPTION=null
60+
MAIL_FROM_ADDRESS="[email protected]"
61+
MAIL_FROM_NAME="${APP_NAME}"
62+
63+
AWS_ACCESS_KEY_ID=
64+
AWS_SECRET_ACCESS_KEY=
65+
AWS_DEFAULT_REGION=us-east-1
66+
AWS_BUCKET=
67+
AWS_USE_PATH_STYLE_ENDPOINT=false
68+
69+
L5_FORMAT_TO_USE_FOR_DOCS=yaml
70+
L5_SWAGGER_UI_FILTERS=false
71+
L5_SWAGGER_USE_ABSOLUTE_PATH=false
72+
L5_SWAGGER_UI_DOC_EXPANSION=list

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto eol=lf
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
10+
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.github/workflows/tests.yaml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
workflow_dispatch:
11+
12+
jobs:
13+
linux_tests:
14+
runs-on: ubuntu-latest
15+
16+
services:
17+
mysql:
18+
image: mysql:5.7
19+
env:
20+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
21+
MYSQL_DATABASE: forge
22+
ports:
23+
- 33306:3306
24+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
25+
26+
strategy:
27+
fail-fast: true
28+
matrix:
29+
php: [8.2, 8.3]
30+
phpunit: ['11.0', '11.4']
31+
phpstan: ['1.12']
32+
paratest: ['7.6']
33+
larastan: ['2.5', '2.9']
34+
35+
name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} - with Paratest ${{ matrix.paratest }} - PHPStan ${{ matrix.phpstan }} - Larastan ${{ matrix.larastan }}
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Setup PHP
42+
uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: ${{ matrix.php }}
45+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp, :php-psr
46+
ini-values: error_reporting=E_ALL
47+
tools: composer:v2
48+
coverage: none
49+
env:
50+
REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4
51+
REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev
52+
53+
- name: Set Framework version
54+
run: composer config version "11.x-dev"
55+
56+
- name: Set minimum PHP 8.2 versions
57+
uses: nick-fields/retry@v3
58+
with:
59+
timeout_minutes: 5
60+
max_attempts: 5
61+
command: composer require guzzlehttp/psr7:^2.4 --no-interaction --no-update
62+
63+
- name: Set PHPUnit
64+
uses: nick-fields/retry@v3
65+
with:
66+
timeout_minutes: 5
67+
max_attempts: 5
68+
command: composer require phpunit/phpunit:^${{ matrix.phpunit }} --dev --no-interaction --no-update
69+
70+
- name: Set Paratest
71+
uses: nick-fields/retry@v3
72+
with:
73+
timeout_minutes: 5
74+
max_attempts: 5
75+
command: composer require brianium/paratest:^${{ matrix.paratest }} --dev --no-interaction --with-all-dependencies
76+
77+
- name: Set PHPStan
78+
uses: nick-fields/retry@v3
79+
with:
80+
timeout_minutes: 5
81+
max_attempts: 5
82+
command: composer require phpstan/phpstan:^${{ matrix.phpstan }} --dev --no-interaction --no-update
83+
84+
- name: Set Larastan
85+
uses: nick-fields/retry@v3
86+
with:
87+
timeout_minutes: 5
88+
max_attempts: 5
89+
command: composer require larastan/larastan:^${{ matrix.larastan }} --dev --no-interaction --no-update
90+
91+
- name: Install dependencies
92+
uses: nick-fields/retry@v3
93+
with:
94+
timeout_minutes: 5
95+
max_attempts: 5
96+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
97+
98+
- name: Execute tests
99+
run: php artisan test --parallel --configuration="phpunit.xml" --no-coverage
100+
env:
101+
DB_CONNECTION: sqlite
102+
DB_DATABASE: ":memory:"
103+
104+
- name: Execute PHPStan
105+
run: vendor/bin/phpstan --configuration="phpstan.neon.dist"
106+
107+
- name: Store artifacts
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: linux-logs-${{ matrix.php }}-${{ matrix.phpunit }}
111+
path: |
112+
vendor/orchestra/testbench-core/laravel/storage/logs
113+
!vendor/**/.gitignore

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/.phpunit.cache
2+
/public/build
3+
/public/hot
4+
/public/storage
5+
/storage/*.key
6+
/storage/pail
7+
/vendor
8+
.DS_Store
9+
.env
10+
.env.backup
11+
.env.production
12+
.phpactor.json
13+
.phpunit.result.cache
14+
Homestead.json
15+
Homestead.yaml
16+
auth.json
17+
/.idea
18+
/.vscode
19+
/.run
20+
/test-reports
21+
/build

.hooks/pre-commit

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
RED='\033[0;31m'
4+
BG_RED=RED='\033[0;41m'
5+
6+
GREEN='\033[0;32m'
7+
BG_GREEN='\033[0;42m\033[30m'
8+
9+
NO_COLOR='\033[0m'
10+
11+
MSG_ERROR="${RED}$(cat $(pwd)/.git/hooks/resources/grumpy-ascii.txt)${NO_COLOR}"
12+
MSG_SUCCESS="${GREEN}$(cat $(pwd)/.git/hooks/resources/happy-ascii.txt)${NO_COLOR}"
13+
MSG=${MSG_SUCCESS}
14+
15+
COMPOSER_PHP_VERSION=$(grep '"php":' composer.json | sed -E 's/[^0-9]*([0-9]+\.[0-9]+).*/\1/')
16+
17+
STATUS=0
18+
STATUS_TEXT="Successful"
19+
20+
run_docker() {
21+
local version="$1"
22+
local command="$2"
23+
24+
docker run --rm -t --entrypoint bash -u "$(id -u):$(id -g)" -v "$(pwd):/var/www/html" "sail-$version/app" -c "$command"
25+
}
26+
27+
run_docker "${COMPOSER_PHP_VERSION}" "php ./vendor/bin/phpstan"
28+
d=$?
29+
if [ $d -ne 0 ]; then
30+
MSG=$MSG_ERROR
31+
STATUS=$d
32+
COLOR=$BG_RED
33+
fi
34+
35+
run_docker "${COMPOSER_PHP_VERSION}" "php artisan test --parallel"
36+
d=$?
37+
if [ $d -ne 0 ]; then
38+
MSG=$MSG_ERROR
39+
STATUS=$d
40+
COLOR=$BG_RED
41+
fi
42+
43+
if [ $STATUS -ne 0 ]; then
44+
STATUS_TEXT="Failed with statuscode: $STATUS"
45+
fi
46+
47+
echo -e "================================================"
48+
echo -e ""
49+
echo -e "${MSG}"
50+
echo -e ""
51+
echo -e "================================================"
52+
53+
exit $STATUS

.hooks/resources/grumpy-ascii.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
██████████████████████████████████
2+
█░░░░░░▀█▀░░░░░░▀█░░░░░░▀█▀░░░░░▀█
3+
█░░▐█▌░░█░░░██░░░█░░██░░░█░░░██░░█
4+
█░░▐█▌░░█░░░██░░░█░░██░░░█░░░██░░█
5+
█░░▐█▌░░█░░░██░░░█░░░░░░▄█░░▄▄▄▄▄█
6+
█░░▐█▌░░█░░░██░░░█░░░░████░░░░░░░█
7+
█░░░█░░░█▄░░░░░░▄█░░░░████▄░░░░░▄█
8+
██████████████████████████████████

.hooks/resources/happy-ascii.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_ _ _ _ _
2+
/ \ | | | __ _ ___ ___ __| | |
3+
/ _ \ | | | / _` |/ _ \ / _ \ / _` | |
4+
/ ___ \| | | | (_| | (_) | (_) | (_| |_|
5+
/_/ \_\_|_| \__, |\___/ \___/ \__,_(_)
6+
|___/

0 commit comments

Comments
 (0)