Skip to content

Commit

Permalink
Upgrade dependencies (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuzana-kunckova authored Apr 18, 2024
1 parent 6266455 commit d90cfe1
Show file tree
Hide file tree
Showing 38 changed files with 8,045 additions and 8,192 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ composer.lock
.phpunit.result.cache
build/
node_modules/
phpunit.xml
.phpunit.cache
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Sendportal Core

## 3.0.0 - 2024-04-18
- Upgrade dependencies to Laravel V11 ([#194](https://github.com/mettle/sendportal-core/pull/194))

## 2.0.3 - 2021-07-05
- Self-host CSS and JS assets ([#144](https://github.com/mettle/sendportal-core/pull/144))
- Handle merge content and subject when subscriber first name or last name are null ([#143](https://github.com/mettle/sendportal-core/pull/143))
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ The [SendPortal](https://github.com/mettle/sendportal) application acts as a wra

## Installation

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.
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.

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).

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).

## Upgrading
## Requirements
SendPortal V3 requires:

- PHP 8.2+
- Laravel 10+
- MySQL (≥ 5.7) or PostgreSQL (≥ 9.4)

If you are on an earlier version of PHP (7.3+) or Laravel (8+), please use [SendPortal V2](https://github.com/mettle/sendportal-core/releases/tag/v2.0.5)


If you already have a copy of SendPortal v1 installed, please follow the [upgrade guide](https://sendportal.io/docs/v2/getting-started/upgrade-guide).
32 changes: 17 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
"license": "MIT",
"authors": [],
"require": {
"php": "^7.3 || ^8.0",
"php": "^8.2|^8.3",
"ext-json": "*",
"aws/aws-sdk-php-laravel": "^3.6",
"doctrine/dbal": "^3.0",
"illuminate/support": "^8.0",
"aws/aws-sdk-php-laravel": "^3.9",
"doctrine/dbal": "^4.0",
"illuminate/support": "^10.0|^11.0",
"kriswallsmith/buzz": "^1.2",
"mailgun/mailgun-php": "^3.2",
"mailjet/mailjet-apiv3-php": "^1.5",
"nyholm/psr7": "^1.3",
"rap2hpoutre/fast-excel": "^2.3",
"sendgrid/sendgrid": "^7.9",
"wildbit/postmark-php": "^4.0",
"postal/postal": "^1.0"
"mailgun/mailgun-php": "^4.2",
"mailjet/mailjet-apiv3-php": "^1.6",
"nyholm/psr7": "^1.8",
"postal/postal": "^2.0",
"rap2hpoutre/fast-excel": "^5.4",
"sendgrid/sendgrid": "^8.1",
"wildbit/postmark-php": "^6.0"
},
"require-dev": {
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.0",
"orchestra/testbench": "^9.0",
"phpunit/phpunit": "^11.0",
"roave/security-advisories": "dev-master"
},
"autoload": {
Expand All @@ -40,10 +40,12 @@
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"

},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"php-http/discovery": true
}
},
"extra": {
"laravel": {
Expand Down
10 changes: 5 additions & 5 deletions database/factories/CampaignFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class CampaignFactory extends Factory
public function definition(): array
{
return [
'name' => $this->faker->sentence,
'name' => $this->faker->sentence(),
'workspace_id' => Sendportal::currentWorkspaceId(),
'subject' => $this->faker->title,
'from_name' => $this->faker->name,
'from_email' => $this->faker->email,
'subject' => $this->faker->title(),
'from_name' => $this->faker->name(),
'from_email' => $this->faker->email(),
'email_service_id' => EmailService::factory(),
'is_open_tracking' => true,
'is_click_tracking' => true,
Expand All @@ -34,7 +34,7 @@ public function withContent(): CampaignFactory
{
return $this->state(function (array $attributes) {
return [
'content' => $this->faker->paragraph,
'content' => $this->faker->paragraph(),
];
});
}
Expand Down
2 changes: 1 addition & 1 deletion database/factories/EmailServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EmailServiceFactory extends Factory
public function definition(): array
{
return [
'name' => ucwords($this->faker->word),
'name' => ucwords($this->faker->word()),
'workspace_id' => Sendportal::currentWorkspaceId(),
'type_id' => $this->faker->randomElement(EmailServiceType::pluck('id')),
'settings' => ['foo' => 'bar'],
Expand Down
8 changes: 4 additions & 4 deletions database/factories/MessageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ class MessageFactory extends Factory
public function definition(): array
{
return [
'hash' => $this->faker->uuid,
'hash' => $this->faker->uuid(),
'workspace_id' => Sendportal::currentWorkspaceId(),
'subscriber_id' => Subscriber::factory(),
'source_type' => Campaign::class,
'source_id' => Campaign::factory(),
'recipient_email' => $this->faker->email,
'recipient_email' => $this->faker->email(),
'subject' => $this->faker->sentence(3),
'from_name' => $this->faker->name,
'from_name' => $this->faker->name(),
'from_email' => '[email protected]',
'message_id' => null,
'ip' => $this->faker->ipv4,
'ip' => $this->faker->ipv4(),
'open_count' => 0,
'click_count' => 0,
'queued_at' => null,
Expand Down
8 changes: 4 additions & 4 deletions database/factories/SubscriberFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public function definition(): array
{
return [
'workspace_id' => Sendportal::currentWorkspaceId(),
'hash' => $this->faker->uuid,
'first_name' => $this->faker->firstName,
'last_name' => $this->faker->lastName,
'email' => $this->faker->safeEmail
'hash' => $this->faker->uuid(),
'first_name' => $this->faker->firstName(),
'last_name' => $this->faker->lastName(),
'email' => $this->faker->safeEmail()
];
}
}
2 changes: 1 addition & 1 deletion database/factories/TagFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function definition(): array
{
return [
'workspace_id' => Sendportal::currentWorkspaceId(),
'name' => ucwords($this->faker->unique()->word)
'name' => ucwords($this->faker->unique()->word())
];
}
}
2 changes: 1 addition & 1 deletion database/factories/TemplateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TemplateFactory extends Factory
public function definition(): array
{
return [
'name' => $this->faker->word,
'name' => $this->faker->word(),
'workspace_id' => Sendportal::currentWorkspaceId(),
'content' => '{{content}}'
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function up()
$campaigns = $this->getTableName('campaigns');

Schema::table($campaigns, function (Blueprint $table) {
$table->longText('content')->change();
$table->longText('content')->nullable()->change();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function up()
$templates = $this->getTableName('templates');

Schema::table($templates, function (Blueprint $table) {
$table->longText('content')->change();
$table->longText('content')->nullable()->change();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ public function up()

protected function listTableForeignKeys(string $table): array
{
$conn = Schema::getConnection()->getDoctrineSchemaManager();

return array_map(function ($key) {
return $key->getName();
}, $conn->listTableForeignKeys($table));
return collect(Schema::getColumnListing($table))
->filter(fn ($column) => Schema::getColumnType($table, $column) === 'foreign')
->map(fn ($column) => "{$column}_foreign")
->toArray();
}
}
Loading

0 comments on commit d90cfe1

Please sign in to comment.