Skip to content

Commit 7bf29b5

Browse files
committed
Merge branch 'main' into dependabot/github_actions/actions/checkout-5
2 parents 7c2136d + 2fe6939 commit 7bf29b5

Some content is hidden

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

53 files changed

+4446
-266
lines changed

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ jobs:
2323
uses: aglipanci/[email protected]
2424

2525
- name: Commit changes
26-
uses: stefanzweifel/git-auto-commit-action@v5
26+
uses: stefanzweifel/git-auto-commit-action@v6
2727
with:
2828
commit_message: Fix styling

README.md

Lines changed: 47 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,58 @@
1-
# This is my package mailbox-for-laravel
1+
# Mailbox for Laravel
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/redberryproducts/mailbox-for-laravel.svg?style=flat-square)](https://packagist.org/packages/redberryproducts/mailbox-for-laravel)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/redberryproducts/mailbox-for-laravel/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/redberryproducts/mailbox-for-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/redberryproducts/mailbox-for-laravel/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/redberryproducts/mailbox-for-laravel/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/redberryproducts/mailbox-for-laravel.svg?style=flat-square)](https://packagist.org/packages/redberryproducts/mailbox-for-laravel)
3+
A Laravel package that captures outgoing mail and stores it for in-app viewing. It adds an `inbox` mail transport, a web dashboard for browsing messages and attachments, and convenient development defaults.
74

8-
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
5+
## Features
96

10-
## Support us
11-
12-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/mailbox-for-laravel.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/mailbox-for-laravel)
13-
14-
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
15-
16-
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
7+
- Registers configuration, routes, views, and an install command for publishing assets and config.
8+
- Adds an `inbox` mailer transport that persists every sent email for later inspection.
9+
- Web dashboard at `/mailbox` (configurable) with authorization middleware.
10+
- Store messages on disk by default with automatic pruning.
11+
- Works out of the box in non-production environments.
1712

1813
## Installation
1914

20-
You can install the package via composer:
21-
22-
```bash
23-
composer require redberryproducts/mailbox-for-laravel
24-
```
25-
26-
You can publish and run the migrations with:
27-
28-
```bash
29-
php artisan vendor:publish --tag="mailbox-for-laravel-migrations"
30-
php artisan migrate
31-
```
32-
33-
You can publish the config file with:
34-
35-
```bash
36-
php artisan vendor:publish --tag="mailbox-for-laravel-config"
37-
```
38-
39-
This is the contents of the published config file:
40-
41-
```php
42-
return [
43-
];
44-
```
45-
46-
Optionally, you can publish the views using
47-
48-
```bash
49-
php artisan vendor:publish --tag="mailbox-for-laravel-views"
50-
```
15+
1. Install the package via Composer:
16+
```bash
17+
composer require redberry/mailbox-for-laravel --dev
18+
```
19+
2. Publish public assets and configuration:
20+
```bash
21+
php artisan mailbox:install
22+
# or
23+
php artisan vendor:publish --tag=mailbox-install
24+
```
25+
3. Register the `inbox` mailer driver in `config/mail.php`:
26+
```php
27+
'mailers' => [
28+
// ...
29+
'inbox' => ['transport' => 'inbox'],
30+
],
31+
```
32+
4. Use the `inbox` mailer by setting it in your `.env`:
33+
```env
34+
MAIL_MAILER=inbox
35+
```
36+
37+
## Configuration
38+
39+
The published `config/inbox.php` file exposes several options:
40+
41+
- `INBOX_ENABLED` &mdash; enable the inbox even in production (defaults to non-production only).
42+
- `INBOX_PUBLIC` &mdash; bypass authorization and allow public access.
43+
- `INBOX_GATE` &mdash; ability checked by the `mailbox.authorize` middleware (defaults to `viewMailbox`).
44+
- `INBOX_DASHBOARD_ROUTE` &mdash; URI where the dashboard is mounted (`/mailbox` by default).
45+
- `INBOX_STORE_DRIVER` & `INBOX_FILE_PATH` &mdash; storage driver and path for captured messages.
46+
- `INBOX_RETENTION` &mdash; number of seconds before stored messages are purged.
5147

5248
## Usage
5349

54-
```php
55-
$mailboxForLaravel = new Redberry\MailboxForLaravel();
56-
echo $mailboxForLaravel->echoPhrase('Hello, Redberry!');
57-
```
50+
Visit the dashboard route to browse stored messages. Attachments and inline assets are served through dedicated routes. Access is protected by the `mailbox.authorize` middleware which uses Laravel's Gate system; define the `viewMailbox` ability or set `INBOX_PUBLIC=true` to expose it without authentication.
5851

5952
## Testing
6053

54+
Run the test suite with:
55+
6156
```bash
6257
composer test
6358
```
@@ -68,17 +63,13 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re
6863

6964
## Contributing
7065

71-
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
66+
Contributions are welcome! Please submit pull requests or open issues on GitHub.
7267

73-
## Security Vulnerabilities
68+
## Security
7469

75-
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
76-
77-
## Credits
78-
79-
- [Nika Jorjoliani](https://github.com/nikajorjika)
80-
- [All Contributors](../../contributors)
70+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
8171

8272
## License
8373

8474
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
75+

composer.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
],
1818
"require": {
1919
"php": "^8.3",
20-
"spatie/laravel-package-tools": "^1.16",
21-
"illuminate/contracts": "^10.0||^11.0||^12.0"
20+
"illuminate/contracts": "^10.0||^11.0||^12.0",
21+
"inertiajs/inertia-laravel": "*",
22+
"livewire/livewire": "^3.6",
23+
"spatie/laravel-package-tools": "^1.16"
2224
},
2325
"require-dev": {
2426
"laravel/pint": "^1.14",
@@ -63,11 +65,8 @@
6365
"extra": {
6466
"laravel": {
6567
"providers": [
66-
"InboxServiceProvider"
67-
],
68-
"aliases": {
69-
"MailboxForLaravel": "Inbox"
70-
}
68+
"Redberry\\MailboxForLaravel\\InboxServiceProvider"
69+
]
7170
}
7271
},
7372
"minimum-stability": "dev",

config/inbox.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

33
return [
4+
'enabled' => env('INBOX_ENABLED', env('APP_ENV') !== 'production'),
5+
'public' => env('INBOX_PUBLIC', false),
46
'store' => [
57
'driver' => env('INBOX_STORE_DRIVER', 'file'),
68
'file' => [
@@ -10,4 +12,7 @@
1012
'retention' => [
1113
'seconds' => (int) env('INBOX_RETENTION', 60 * 60 * 24),
1214
],
15+
'gate' => env('INBOX_GATE', 'viewMailbox'),
16+
'route' => env('INBOX_DASHBOARD_ROUTE', 'mailbox'),
17+
'middleware' => ['web'],
1318
];

dist/assets/mailbox-BTusqyio.js

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assets/mailbox-Bg83JC1d.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/manifest.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"resources/js/mailbox.js": {
3+
"file": "assets/mailbox-BTusqyio.js",
4+
"name": "mailbox",
5+
"src": "resources/js/mailbox.js",
6+
"isEntry": true,
7+
"css": [
8+
"assets/mailbox-Bg83JC1d.css"
9+
]
10+
}
11+
}

0 commit comments

Comments
 (0)