Skip to content

Commit 15643e8

Browse files
committed
chore:upgrade laravel v10.3.2
1 parent 358781c commit 15643e8

31 files changed

+220
-119
lines changed

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ root = true
33
[*]
44
charset = utf-8
55
end_of_line = lf
6-
insert_final_newline = true
7-
indent_style = space
86
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

1111
[*.md]

.env.example

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ FLARE_KEY=
1212
DB_CONNECTION=pgsql
1313
DB_HOST=127.0.0.1
1414
DB_PORT=5432
15-
DB_DATABASE=short-url
15+
DB_DATABASE=:project_slug
1616
DB_USERNAME=postgres
1717
DB_PASSWORD=
1818

@@ -23,13 +23,14 @@ QUEUE_CONNECTION=sync
2323
SESSION_DRIVER=file
2424
SESSION_LIFETIME=120
2525

26+
MEMCACHED_HOST=127.0.0.1
27+
2628
REDIS_HOST=127.0.0.1
27-
REDIS_USERNAME=null
2829
REDIS_PASSWORD=null
2930
REDIS_PORT=6379
3031

3132
MAIL_MAILER=smtp
32-
MAIL_HOST=mailhog
33+
MAIL_HOST=mailpit
3334
MAIL_PORT=1025
3435
MAIL_USERNAME=null
3536
MAIL_PASSWORD=null

.env.sail.example

+9-10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ FORWARD_DB_PORT=5430
1414
DB_CONNECTION=pgsql
1515
DB_HOST=127.0.0.1
1616
DB_PORT=5432
17-
DB_DATABASE=api_skeleton_laravel
17+
DB_DATABASE=:project_slug
1818
DB_USERNAME=
1919
DB_PASSWORD=password
2020

@@ -33,7 +33,7 @@ REDIS_PASSWORD=null
3333
REDIS_PORT=6379
3434

3535
MAIL_MAILER=smtp
36-
MAIL_HOST=mailhog
36+
MAIL_HOST=mailpit
3737
MAIL_PORT=1025
3838
MAIL_USERNAME=null
3939
MAIL_PASSWORD=null
@@ -53,14 +53,6 @@ SCOUT_DRIVER=meilisearch
5353
MEILISEARCH_HOST=http://meilisearch:7700
5454
MEILISEARCH_KEY=a650qbuwj4t3k5dpebsxydqq1d3s8ojn
5555

56-
# Apple Silicon
57-
# MEILISEARCH_IMAGE=metamehta/meilisearch-arm64:latest
58-
# MEILISEARCH_PLATFORM=linux/arm64
59-
60-
# Normal
61-
MEILISEARCH_IMAGE=getmeili/meilisearch
62-
MEILISEARCH_PLATFORM=linux/amd64
63-
6456
OCTANE_SERVER=roadrunner
6557

6658
PUSHER_APP_ID=
@@ -70,3 +62,10 @@ PUSHER_HOST=
7062
PUSHER_PORT=443
7163
PUSHER_SCHEME=https
7264
PUSHER_APP_CLUSTER=mt1
65+
66+
VITE_APP_NAME="${APP_NAME}"
67+
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
68+
VITE_PUSHER_HOST="${PUSHER_HOST}"
69+
VITE_PUSHER_PORT="${PUSHER_PORT}"
70+
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
71+
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.github/workflows/phpstan.yml

+26-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
name: PHPStan
22

3-
on:
4-
push:
5-
paths:
6-
- '**.php'
7-
- 'phpstan.neon.dist'
8-
- 'phpstan-baseline.neon'
3+
#on:
4+
# push:
5+
# paths:
6+
# - '**.php'
7+
# - 'phpstan.neon.dist'
8+
# - 'phpstan-baseline.neon'
99

1010
jobs:
11-
phpstan:
12-
name: phpstan
13-
runs-on: ubuntu-latest
11+
tests:
12+
runs-on: ubuntu-22.04
13+
14+
strategy:
15+
fail-fast: true
16+
17+
name: Static Analysis
18+
1419
steps:
15-
- uses: actions/checkout@v3
20+
- name: Check out repository code
21+
uses: actions/checkout@v4
1622

1723
- name: Setup PHP
1824
uses: shivammathur/setup-php@v2
1925
with:
20-
php-version: '8.2'
26+
php-version: 8.2
27+
tools: composer:v2
2128
coverage: none
2229

30+
- name: Composer & GitHub Authentication
31+
run: composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
32+
2333
- name: Install composer dependencies
24-
uses: ramsey/composer-install@v2
34+
uses: nick-fields/retry@v2
35+
with:
36+
timeout_minutes: 3
37+
max_attempts: 5
38+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
2539

2640
- name: Run PHPStan
2741
timeout-minutes: 2

.github/workflows/pint.yml

+19-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
name: Check & fix styling
22

3-
on:
4-
push:
5-
paths:
6-
- '**.php'
3+
#on:
4+
# push:
5+
# paths:
6+
# - '**.php'
77

88
jobs:
99
Test:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-22.04
11+
12+
strategy:
13+
fail-fast: true
1114

1215
steps:
1316
- name: Check out repository code
14-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1518

1619
- name: Setup PHP
1720
uses: shivammathur/setup-php@v2
1821
with:
19-
php-version: '8.2'
22+
php-version: 8.2
23+
tools: composer:v2
2024
coverage: none
2125

26+
- name: Composer & GitHub Authentication
27+
run: composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
28+
2229
- name: Install composer dependencies
23-
uses: ramsey/composer-install@v2
30+
uses: nick-fields/retry@v2
31+
with:
32+
timeout_minutes: 3
33+
max_attempts: 5
34+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
2435

2536
- name: Check code style
2637
timeout-minutes: 2

.github/workflows/run-tests.yml

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
name: Run tests
22

3-
on:
4-
push:
5-
paths:
6-
- '**.php'
7-
- 'phpunit.xml'
8-
- 'composer.json'
9-
- 'composer.lock'
3+
#on:
4+
# push:
5+
# paths:
6+
# - '**.php'
7+
# - 'phpunit.xml'
8+
# - 'composer.json'
9+
# - 'composer.lock'
1010

1111
jobs:
1212
phpunit:
1313
name: Run tests
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
15+
1516
steps:
16-
- uses: actions/checkout@v3
17+
- name: Check out repository code
18+
uses: actions/checkout@v4
1719

1820
- name: Setup PHP
1921
uses: shivammathur/setup-php@v2
2022
with:
2123
php-version: '8.2'
22-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif
24+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, exif
25+
ini-values: error_reporting=E_ALL
26+
tools: composer:v2
2327
coverage: none
2428

29+
- name: Composer & GitHub Authentication
30+
run: composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
31+
2532
- name: Run composer install
2633
run: composer install -n --prefer-dist
2734

.github/workflows/update-changelog.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v3
12+
- name: Check out repository code
13+
uses: actions/checkout@v4
1414
with:
1515
ref: main
16-
token: ${{ secrets.BE_GH_TOKEN }}
16+
token: ${{ secrets.GITHUB_TOKEN }}
1717

1818
- name: Update Changelog
1919
uses: stefanzweifel/changelog-updater-action@v1
@@ -22,7 +22,7 @@ jobs:
2222
release-notes: ${{ github.event.release.body }}
2323

2424
- name: Commit updated CHANGELOG
25-
uses: stefanzweifel/git-auto-commit-action@v4
25+
uses: stefanzweifel/git-auto-commit-action@v5
2626
with:
2727
branch: main
2828
commit_message: Update CHANGELOG

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog
2+
3+
All notable changes to `:project_title` will be documented in this file.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1 align="center">:vendor_name - :project_title</h1>
22
<p align="center">
3-
<a href="https://laravel.com/docs/10.x"><img src="https://img.shields.io/badge/Laravel-10.x-red" alt="Laravel 10"></a>
4-
<a href="https://www.php.net/releases/8.2/en.php"><img src="https://img.shields.io/badge/php-%5E8.2-blue" alt="PHP 8.2"></a>
3+
<a href="https://laravel.com/docs/10.x"><img src="https://img.shields.io/badge/Laravel-10.x-red?style=flat-square&logo=Laravel" alt="Laravel 10"></a>
4+
<a href="https://www.php.net/releases/8.2/en.php"><img src="https://img.shields.io/badge/php-%5E8.2-blue?style=flat-square&logo=php" alt="PHP 8.2"></a>
55
</p>
66

77
<!--delete-->

app/Exceptions/Handler.php

+2-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Handler extends ExceptionHandler
1717
{
1818
/**
19-
* A list of the inputs that are never flashed to the session on validation exceptions.
19+
* The list of the inputs that are never flashed to the session on validation exceptions.
2020
*
2121
* @var array<int, string>
2222
*/
@@ -39,41 +39,34 @@ public function register(): void
3939
public function render($request, Throwable $e)
4040
{
4141
if ($request->wantsJson() || $request->is('api/*')) {
42-
43-
switch (get_class($e)) {
42+
switch ($e::class) {
4443
case ModelNotFoundException::class:
45-
4644
return Response::error([
4745
'message' => class_basename($e->getModel()).' Not Found',
4846
], Http::HTTP_NOT_FOUND);
4947

5048
case NotFoundHttpException::class:
51-
5249
return Response::error([
5350
'message' => 'Requested url not found',
5451
], Http::HTTP_NOT_FOUND);
5552

5653
case ValidationException::class:
57-
5854
return Response::error([
5955
'message' => $e->getMessage(),
6056
'errors' => $e->errors(),
6157
], $e->status);
6258

6359
case AuthorizationException::class:
64-
6560
return Response::error([
6661
'message' => $e->getMessage(),
6762
], Http::HTTP_FORBIDDEN);
6863

6964
case AuthenticationException::class:
70-
7165
return Response::error([
7266
'message' => $e->getMessage(),
7367
], Http::HTTP_UNAUTHORIZED);
7468

7569
case InvalidSignatureException::class:
76-
7770
if ($request->routeIs('verification.verify')) {
7871
return Response::error([
7972
'message' => 'Verification link expired',
@@ -85,15 +78,13 @@ public function render($request, Throwable $e)
8578
], $e->getStatusCode());
8679

8780
default:
88-
8981
$statusCode = (int) $e->getCode();
9082

9183
if ($this->validStatusCode($statusCode)) {
9284
return Response::error([
9385
'message' => $e->getMessage(),
9486
], $e->getCode());
9587
}
96-
9788
}
9889
}
9990

app/Http/Middleware/CheckApiToken.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CheckApiToken
1717
public function handle(Request $request, Closure $next, string $app)
1818
{
1919
$token = $request->header('x_api_token');
20-
if (! $token || ! data_get(config('api-tokens'), $token) || data_get(config('api-tokens'), $token) != $app) {
20+
if (! $token || ! data_get(config('api-tokens'), $token) || data_get(config('api-tokens'), $token) !== $app) {
2121
return Response::error(
2222
['message' => 'Invalid Api Token!'],
2323
Http::HTTP_UNAUTHORIZED

app/Http/Middleware/ValidateSignature.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class ValidateSignature extends Middleware
88
{
99
/**
10-
* The names of the query string that should be ignored.
10+
* The names of the query string parameters that should be ignored.
1111
*
1212
* @var array<int, string>
1313
*/

app/Providers/AuthServiceProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Providers;
44

5+
// use Illuminate\Support\Facades\Gate;
56
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
67

78
class AuthServiceProvider extends ServiceProvider

app/Providers/RouteServiceProvider.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class RouteServiceProvider extends ServiceProvider
1414
* The path to your application's "home" route.
1515
*
1616
* Typically, users are redirected here after authentication.
17-
*
18-
* @var string
1917
*/
2018
public const HOME = '/dashboard';
2119

@@ -29,8 +27,8 @@ public function boot(): void
2927
});
3028

3129
$this->routes(function () {
32-
Route::prefix('api')
33-
->middleware('api')
30+
Route::middleware('api')
31+
->prefix('api')
3432
->group(base_path('routes/api.php'));
3533

3634
Route::middleware('web')

0 commit comments

Comments
 (0)