Skip to content

Commit b176aa4

Browse files
authored
Merge pull request #6 from MasterRO94/v2
V2
2 parents f6b110c + 87dba10 commit b176aa4

Some content is hidden

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

60 files changed

+78734
-14877
lines changed

.github/workflows/tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
php: [8.0, 8.1]
17+
stability: [prefer-lowest, prefer-stable]
18+
19+
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
extensions: dom, curl, libxml, mbstring, zip
30+
coverage: none
31+
32+
- name: Install dependencies
33+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
34+
35+
- name: Execute tests
36+
run: vendor/bin/phpunit --verbose

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/node_modules
44
composer.lock
55
.idea
6+
.phpunit.result.cache

README.md

Lines changed: 82 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,112 @@
1414
</a>
1515
</p>
1616

17-
# Laravel 5.5+ mail logger and viewer
18-
### Easily log and view and search in browser outgoing emails.
17+
# Laravel mail logger and viewer
1918

20-
![preview](https://github.com/MasterRO94/packages/blob/master/mail-viewer/Mail%20Viewer%20Test%20App%20-%20Mail%20Viewer%202020-03-03%2014-02-25.png "Preview")
19+
### Easily log, view and search in browser all outgoing emails.
2120

22-
This package gives an ability to log all outgoing emails to a database and view them all from a browser like they will be shown in a modern mail clients (gmail, etc.).
21+
![preview](https://github.com/MasterRO94/packages/blob/master/mail-viewer/Mail%20Viewer%20V2.png "Preview")
2322

24-
## Installation
23+
This package gives an ability to log all outgoing emails to a database and view them all from a browser like they will
24+
be shown in a modern mail clients (gmail, etc.).
2525

26-
### Step 1: Composer
26+
## Version Compatibility
2727

28-
From the command line, run:
28+
| Laravel | Mail Viewer |
29+
|:------------|:------------|
30+
| 5.5.x - 8.* | 1.3.x |
31+
| 9.x | 2.x.x |
32+
33+
## Upgrade from v1 to v2
34+
35+
Version 2 has been almost totally rewritten and brings totally new fresh UI build with Vue.js 3 and TailwindCss 3.
36+
It works **only with Laravel 9+** as of Symfony Mailer replacement for previously used Swift Mailer.
37+
38+
### Upgrade Steps
39+
40+
#### Composer Dependencies
41+
42+
You should update the dependency in your application's composer.json file:
43+
44+
`masterro/laravel-mail-viewer` to ^2.0
45+
46+
#### Database migrations
2947

48+
Run package migrations (requires `doctrine/dbal` to be installed):
49+
50+
```shell
51+
php artisan migrate
3052
```
31-
composer require masterro/laravel-mail-viewer
53+
54+
#### Publish assets
55+
56+
Run publish command:
57+
58+
```shell
59+
php artisan mail-viewer:publish --views
3260
```
3361

34-
### Step 2: Service Provider (Supports package auto-discovery)
62+
#### Update configs
3563

36-
For manual registration open `config/app.php` and, within the `providers` array, append:
64+
V2 uses separate date format for date and time, update these in your `config/mail-viewer.php` file
3765

66+
```php
67+
'date_format' => 'd.m.Y',
68+
'time_format' => 'H:i:s',
3869
```
39-
MasterRO\MailViewer\Providers\MailViewerServiceProvider::class
70+
71+
#### Data pruning
72+
73+
V2 allows prune old records easily using `mail-viewer:prune` command. You can add it to your Scheduler.
74+
75+
```php
76+
// Console/Kernel.php
77+
$schedule->command('mail-viewer:prune')->daily();
4078
```
4179

42-
This will bootstrap the package into Laravel.
80+
You can specify how many days data will be stored before pruning using config. Default value is 31 days.
4381

44-
### Step 3: Publish Configs
82+
```php
83+
'prune_older_than_days' => 31,
84+
```
85+
86+
## Installation
87+
88+
### Step 1: Composer
89+
90+
From the command line, run:
91+
92+
```
93+
composer require masterro/laravel-mail-viewer
94+
```
95+
96+
### Step 2: Publish assets and configs
4597

4698
```
4799
php artisan mail-viewer:publish
48100
```
49101

50102
You have to publish _**assets,**_ and _**views,**_ _configs_ are optional.
51103

52-
53-
### Step 4: Run migrations
104+
### Step 3: Run migrations
54105

55106
```
56107
php artisan migrate
57108
```
58109

59-
### Step 5: View emails
60-
All ongoing emails you can find on `/_mail-viewer` page.
110+
### Step 4: View emails
111+
112+
All ongoing emails you can find on `/_mail-viewer` page.
113+
114+
## Configuration
115+
116+
You can review and change all the default configuration values in published `config/mail-viewer.php` file.
117+
118+
#### Data pruning (v2+)
119+
120+
The package allows you to prune old records easily using `mail-viewer:prune` command. You can add it to your Scheduler.
121+
122+
```php
123+
// Console/Kernel.php
124+
$schedule->command('mail-viewer:prune')->daily();
125+
```

composer.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@
1515
"log"
1616
],
1717
"require": {
18-
"illuminate/support": "^5.5|^6.0|^7.0|^8.0",
19-
"illuminate/events": "^5.5|^6.0|^7.0|^8.0",
20-
"illuminate/database": "^5.5|^6.20.14|^7.0|^8.0",
21-
"illuminate/routing": "^5.5|^6.0|^7.0|^8.0",
22-
"illuminate/mail": "^5.5|^6.0|^7.0|^8.0"
18+
"illuminate/support": "^9.0",
19+
"illuminate/events": "^9.0",
20+
"illuminate/database": "^9.0",
21+
"illuminate/routing": "^9.0",
22+
"illuminate/view": "^9.0",
23+
"illuminate/mail": "^9.0",
24+
"doctrine/dbal": "^3.3"
2325
},
2426
"require-dev": {
25-
"orchestra/testbench": "^3.5|v4.0|v5.0||v6.0"
27+
"orchestra/testbench": "^7.0.0"
2628
},
2729
"autoload": {
2830
"psr-4": {
29-
"MasterRO\\MailViewer\\": "src/app"
31+
"MasterRO\\MailViewer\\": "src/app",
32+
"MasterRO\\MailViewer\\Tests\\": "tests/"
3033
}
3134
},
3235
"minimum-stability": "dev",

mix-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"/C:/src/public/js/app.js": "/C:/src/public/js/app.js",
2+
"/src/public/js/app.js": "/src/public/js/app.js",
33
"/src/public/css/app.css": "/src/public/css/app.css"
4-
}
4+
}

0 commit comments

Comments
 (0)