Skip to content

Commit dbf8a7b

Browse files
authored
Merge pull request #16 from davidrushton/master
Added basic auth middleware to PostmarkController
2 parents 0fb7978 + 22bc6da commit dbf8a7b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Http/Controllers/PostmarkController.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
namespace BeyondCode\Mailbox\Http\Controllers;
44

5+
use Illuminate\Routing\Controller;
56
use BeyondCode\Mailbox\Facades\Mailbox;
67
use BeyondCode\Mailbox\Http\Requests\PostmarkRequest;
78

8-
class PostmarkController
9+
class PostmarkController extends Controller
910
{
11+
public function __construct()
12+
{
13+
$this->middleware('laravel-mailbox');
14+
}
15+
1016
public function __invoke(PostmarkRequest $request)
1117
{
1218
Mailbox::callMailboxes($request->email());

tests/Controllers/PostmarkTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ protected function getEnvironmentSetUp($app)
1616
/** @test */
1717
public function it_expects_to_receive_raw_email_field()
1818
{
19+
$this->withoutMiddleware();
20+
1921
$this->post('/laravel-mailbox/postmark', [
2022
'something' => 'value',
2123
])->assertSessionHasErrors('RawEmail')->assertStatus(302);

0 commit comments

Comments
 (0)