Skip to content

Commit fc5c504

Browse files
authored
Merge pull request #290 from zuzana-kunckova/laravel-upgrade
Laravel version 11 upgrade
2 parents 7ee9866 + 8c32e9e commit fc5c504

File tree

96 files changed

+369
-617
lines changed

Some content is hidden

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

96 files changed

+369
-617
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on: push
2+
name: Laravel CI
3+
jobs:
4+
phpunit:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
container: [
9+
"kirschbaumdevelopment/laravel-test-runner:8.2",
10+
"kirschbaumdevelopment/laravel-test-runner:8.3"
11+
]
12+
13+
container:
14+
image: ${{ matrix.container }}
15+
16+
name: ${{ matrix.container }}
17+
18+
services:
19+
mysql:
20+
image: mysql:5.7
21+
env:
22+
MYSQL_ROOT_PASSWORD: password
23+
MYSQL_USER: homestead
24+
MYSQL_PASSWORD: secret
25+
MYSQL_DATABASE: sendportal_dev
26+
ports:
27+
- 3306:3306
28+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
29+
30+
postgres:
31+
image: postgres
32+
env:
33+
POSTGRES_USER: homestead
34+
POSTGRES_PASSWORD: secret
35+
POSTGRES_DB: sendportal_dev
36+
ports:
37+
- 5432:5432
38+
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
39+
40+
steps:
41+
- uses: actions/checkout@v3
42+
- name: Install composer dependencies
43+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
44+
- name: Run Testsuite against MySQL
45+
run: vendor/bin/phpunit
46+
env:
47+
DB_CONNECTION: mysql
48+
DB_HOST: mysql
49+
DB_PORT: 3306
50+
- name: Run Testsuite against Postgres
51+
run: vendor/bin/phpunit
52+
env:
53+
DB_CONNECTION: pgsql
54+
DB_HOST: postgres
55+
DB_PORT: 5432

.github/workflows/format.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Format [PHP]
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.php'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
php-cs-fixer:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
20+
- name: Run php-cs-fixer
21+
uses: docker://oskarstark/php-cs-fixer-ga:3.13.0
22+
with:
23+
args: --config=.php-cs-fixer.dist.php
24+
25+
- uses: stefanzweifel/git-auto-commit-action@v4
26+
with:
27+
commit_message: Apply php-cs-fixer changes
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Sendportal
22

3+
## 3.0.0 - 2024-04-19
4+
- Update to Laravel 11 ([#290](https://github.com/mettle/sendportal/pull/290)
5+
36
## 2.0.3 - 2021-07-05
47
- Allow overwrite phpunit.xml only locally ([#148](https://github.com/mettle/sendportal/pull/148))
58

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ The [SendPortal](https://github.com/mettle/sendportal) application acts as a wra
1919

2020
## Installation
2121

22-
As of Version 2, SendPortal can be installed as a stand-alone application (i.e. including everything you need to run SendPortal), or as a package inside an existing Laravel application.
23-
2422
If you would like to install SendPortal as a stand-alone application, please follow the [installation guide](https://sendportal.io/docs/v2/getting-started/installation).
2523

2624
If you would like to add SendPortal to an existing application, please follow the [package installation guide](https://sendportal.io/docs/v2/getting-started/package-installation).
2725

28-
## Upgrading
26+
## Requirements
27+
SendPortal V3 requires:
28+
29+
- PHP 8.2+
30+
- Laravel 10+
31+
- MySQL (≥ 5.7) or PostgreSQL (≥ 9.4)
32+
33+
If you are on an earlier version of PHP (7.3+) or Laravel (8+), please use [SendPortal V2](https://github.com/mettle/sendportal/releases/tag/v2.0.4)
2934

30-
If you already have a copy of SendPortal v1 installed, please follow the [upgrade guide](https://sendportal.io/docs/v2/getting-started/upgrade-guide).

app/Console/Commands/InstallApplication.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function checkEnvironment(): void
9090
*/
9191
protected function checkApplicationKey(): void
9292
{
93-
if ( ! config('app.key')) {
93+
if (! config('app.key')) {
9494
$this->call('key:generate');
9595
}
9696

@@ -103,7 +103,7 @@ protected function checkApplicationKey(): void
103103
protected function checkAppUrl(): void
104104
{
105105
if (config('app.url') !== 'http://localhost') {
106-
$this->info('✓ Application url set to ' . config('app.url'));
106+
$this->info('✓ Application url set to '.config('app.url'));
107107

108108
return;
109109
}
@@ -121,7 +121,7 @@ protected function checkDatabaseConnection(): void
121121
$this->info('✓ Database connection successful');
122122
} catch (Exception $e) {
123123
try {
124-
if ( ! $this->createDatabaseCredentials()) {
124+
if (! $this->createDatabaseCredentials()) {
125125
$this->error(
126126
'A database connection could not be established. Please update your configuration and try again.'
127127
);
@@ -144,7 +144,7 @@ protected function createDatabaseCredentials(): bool
144144
true
145145
);
146146

147-
if ( ! $storeCredentials) {
147+
if (! $storeCredentials) {
148148
return false;
149149
}
150150

@@ -211,7 +211,7 @@ protected function getCompanyName(): string
211211
$this->line('Creating first admin user account and company/workspace');
212212
$companyName = $this->ask('Company/Workspace name');
213213

214-
if ( ! $companyName) {
214+
if (! $companyName) {
215215
return $this->getCompanyName();
216216
}
217217

@@ -271,7 +271,7 @@ protected function getUserParam(string $param): string
271271

272272
if ($validator->fails()) {
273273
foreach ($validator->errors()->getMessages() as $error) {
274-
$this->line((string)($error[0]));
274+
$this->line((string) ($error[0]));
275275
}
276276

277277
return $this->getUserParam($param);
@@ -312,7 +312,7 @@ protected function checkVendorAssets(): void
312312
[
313313
'--provider' => SendportalBaseServiceProvider::class,
314314
'--tag' => 'sendportal-assets',
315-
'--force' => true
315+
'--force' => true,
316316
]
317317
);
318318

@@ -329,11 +329,11 @@ protected function printDatabaseConfig(): void
329329
$this->line('');
330330
$this->info('Database Configuration:');
331331
$this->line("- Connection: {$connection}");
332-
$this->line('- Host: ' . config("database.connections.{$connection}.host"));
333-
$this->line('- Port: ' . config("database.connections.{$connection}.port"));
334-
$this->line('- Database: ' . config("database.connections.{$connection}.database"));
335-
$this->line('- Username: ' . config("database.connections.{$connection}.username"));
336-
$this->line('- Password: ' . config("database.connections.{$connection}.password"));
332+
$this->line('- Host: '.config("database.connections.{$connection}.host"));
333+
$this->line('- Port: '.config("database.connections.{$connection}.port"));
334+
$this->line('- Database: '.config("database.connections.{$connection}.database"));
335+
$this->line('- Username: '.config("database.connections.{$connection}.username"));
336+
$this->line('- Password: '.config("database.connections.{$connection}.password"));
337337
}
338338

339339
/**
@@ -344,7 +344,7 @@ protected function persistVariables(array $connectionData): void
344344
$connection = $connectionData['DB_CONNECTION'];
345345

346346
$configMap = [
347-
'DB_CONNECTION' => "database.default",
347+
'DB_CONNECTION' => 'database.default',
348348
'DB_HOST' => "database.connections.{$connection}.host",
349349
'DB_PORT' => "database.connections.{$connection}.port",
350350
'DB_DATABASE' => "database.connections.{$connection}.database",
@@ -374,7 +374,7 @@ protected function writeToEnvironmentFile(string $key, ?string $value): void
374374
)
375375
);
376376

377-
if ( ! $this->checkEnvValuePresent($key, $value)) {
377+
if (! $this->checkEnvValuePresent($key, $value)) {
378378
throw new RuntimeException("Failed to persist environment variable value. {$key}={$value}");
379379
}
380380
}

app/Console/Commands/UpgradeApplication.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ class UpgradeApplication extends BaseCommand
3434

3535
/**
3636
* Execute the console command.
37-
*
38-
* @return int
3937
*/
4038
public function handle(): int
4139
{
@@ -62,7 +60,7 @@ protected function checkVendorAssets(): void
6260
'vendor:publish',
6361
[
6462
'--provider' => SendportalBaseServiceProvider::class,
65-
'--force' => true
63+
'--force' => true,
6664
]
6765
);
6866

app/Console/Kernel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class Kernel extends ConsoleKernel
1919
/**
2020
* Define the application's command schedule.
2121
*
22-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
2322
* @return void
2423
*/
2524
protected function schedule(Schedule $schedule)

app/Exceptions/Handler.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class Handler extends ExceptionHandler
2929
/**
3030
* Report or log an exception.
3131
*
32-
* @param \Throwable $exception
3332
* @return void
3433
*
3534
* @throws \Exception
@@ -43,7 +42,6 @@ public function report(Throwable $exception)
4342
* Render an exception into an HTTP response.
4443
*
4544
* @param \Illuminate\Http\Request $request
46-
* @param \Throwable $exception
4745
* @return \Symfony\Component\HttpFoundation\Response
4846
*
4947
* @throws \Throwable

app/Http/Controllers/Auth/ChangePasswordController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function edit(): View
2020
public function update(ChangePasswordRequest $request): RedirectResponse
2121
{
2222
$request->user()->update([
23-
'password'=> Hash::make($request->password)
23+
'password' => Hash::make($request->password),
2424
]);
2525

2626
return redirect()->route('profile.show')

app/Http/Controllers/Auth/ConfirmPasswordController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace App\Http\Controllers\Auth;
66

7-
use Illuminate\Foundation\Auth\ConfirmsPasswords;
87
use App\Http\Controllers\Controller;
8+
use Illuminate\Foundation\Auth\ConfirmsPasswords;
99

1010
class ConfirmPasswordController extends Controller
1111
{

0 commit comments

Comments
 (0)