Skip to content

Commit 523970d

Browse files
Merge pull request #1 from BinarCode/master
Origin
2 parents 0cb587b + 07e6fc7 commit 523970d

File tree

6 files changed

+23
-44
lines changed

6 files changed

+23
-44
lines changed

.github/workflows/psalm.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/run-tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ jobs:
1010
matrix:
1111
os: [ubuntu-latest]
1212
php: [7.4]
13-
laravel: [7.*]
13+
laravel: [^7.0, ^8.0]
1414
dependency-version: [prefer-stable]
1515
include:
16-
- laravel: 7.*
17-
testbench: 5.*
16+
- laravel: ^7.0
17+
testbench: ^5.2
18+
- laravel: ^8.0
19+
testbench: ^6.0
1820

1921
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
2022

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ You can install the package via composer:
1616
composer require binarcode/laravel-mailator
1717
```
1818

19+
## Publish
20+
21+
Publish migrations: `a vendor:publish --tag=mailator-migrations`
22+
23+
Publish config: `a vendor:publish --tag=mailator-config`
24+
1925
## Usage
2026

2127
It has mainly 2 directions of usage:

composer.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@
1818
],
1919
"require": {
2020
"php": "^7.4",
21-
"illuminate/support": "^7.0",
21+
"illuminate/support": "^7.0|^8.0",
2222
"opis/closure": "^3.5",
2323
"tijsverkoyen/css-to-inline-styles": "^2.2"
2424
},
2525
"require-dev": {
2626
"friendsofphp/php-cs-fixer": "^2.16",
27-
"orchestra/testbench": "^5.0",
27+
"laravel/legacy-factories": "^1.0",
28+
"orchestra/testbench": "^5.2|^6.0",
2829
"phpunit/phpunit": "^9.0",
29-
"spatie/test-time": "^1.2",
30-
"psalm/plugin-laravel": "^1.2",
31-
"vimeo/psalm": "^3.11"
30+
"spatie/test-time": "^1.2"
3231
},
3332
"autoload": {
3433
"psr-4": {
@@ -41,7 +40,6 @@
4140
}
4241
},
4342
"scripts": {
44-
"psalm": "vendor/bin/psalm",
4543
"test": "vendor/bin/phpunit",
4644
"test-coverage": "vendor/bin/phpunit --coverage-html coverage",
4745
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes"

src/Models/MailTemplate.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ class MailTemplate extends Model implements MailTemplateable
3838

3939
public function placeholders()
4040
{
41-
return $this->hasMany(MailTemplatePlaceholder::class, 'mail_template_id');
41+
return $this->hasMany(
42+
config('mailator.templates.placeholder_model') ?? MailTemplatePlaceholder::class,
43+
'mail_template_id'
44+
);
4245
}
4346

4447
public function htmlWithInlinedCss(): string

src/Models/MailTemplatePlaceholder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class MailTemplatePlaceholder extends Model
2222

2323
public function mailTemplate()
2424
{
25-
return $this->belongsTo(MailTemplate::class, 'mail_template_id');
25+
return $this->belongsTo(
26+
config('mailator.templates.template_model') ?? MailTemplate::class,
27+
'mail_template_id'
28+
);
2629
}
2730
}

0 commit comments

Comments
 (0)