Skip to content

Commit fcf1620

Browse files
committed
wip
1 parent 7dbce68 commit fcf1620

File tree

8 files changed

+43
-5
lines changed

8 files changed

+43
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"BeyondCode\\Mailbox\\MailboxServiceProvider"
5555
],
5656
"aliases": {
57-
"Mailbox": "BeyondCode\\Mailbox\\MailboxFacade"
57+
"Mailbox": "BeyondCode\\Mailbox\\Facades\\Mailbox"
5858
}
5959
}
6060
}

config/mailbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Supported drivers: "log", "mailgun"
1010
*/
11-
'driver' => env('MAIL_DRIVER', 'log'),
11+
'driver' => env('MAILBOX_DRIVER', 'log'),
1212

1313
/*
1414
* The path for driver specific routes. This is where

database/migrations/create_mailbox_inbound_emails_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Database\Migrations\Migration;
66

7-
class CreateMailboxInboundEmails extends Migration
7+
class CreateMailboxInboundEmailsTable extends Migration
88
{
99
/**
1010
* Run the migrations.

src/Drivers/SendGrid.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace BeyondCode\Mailbox\Drivers;
4+
5+
use BeyondCode\Mailbox\Http\Controllers\SendGridController;
6+
use Illuminate\Support\Facades\Route;
7+
8+
class SendGrid implements DriverInterface
9+
{
10+
11+
public function register()
12+
{
13+
Route::prefix(config('mailbox.path'))->group(function () {
14+
Route::post('/sendgrid', SendGridController::class);
15+
});
16+
}
17+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace BeyondCode\Mailbox\Http\Controllers;
4+
5+
class SendGridController
6+
{
7+
public function __invoke()
8+
{
9+
10+
}
11+
}

src/MailboxManager.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace BeyondCode\Mailbox;
44

5+
use BeyondCode\Mailbox\Drivers\SendGrid;
56
use Illuminate\Support\Manager;
67
use BeyondCode\Mailbox\Drivers\Log;
78
use BeyondCode\Mailbox\Drivers\Mailgun;
@@ -24,6 +25,11 @@ public function createMailgunDriver()
2425
return new Mailgun;
2526
}
2627

28+
public function createSendGridDriver()
29+
{
30+
return new SendGrid;
31+
}
32+
2733
public function getDefaultDriver()
2834
{
2935
return $this->app['config']['mailbox.driver'];

src/MailboxServiceProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ class MailboxServiceProvider extends ServiceProvider
1212
*/
1313
public function boot()
1414
{
15-
if (! class_exists('CreateMailboxInboundEmails')) {
15+
if (! class_exists('CreateMailboxInboundEmailsTable')) {
1616
$this->publishes([
1717
__DIR__.'/../database/migrations/create_mailbox_inbound_emails_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_mailbox_inbound_emails_table.php'),
1818
], 'migrations');
1919
}
2020

21+
$this->publishes([
22+
__DIR__.'/../config/mailbox.php' => config_path('mailbox.php')
23+
], 'config');
24+
2125
$this->registerDriver();
2226
}
2327

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ protected function getEnvironmentSetUp($app)
1616
{
1717
include_once __DIR__.'/../database/migrations/create_mailbox_inbound_emails_table.php.stub';
1818

19-
(new \CreateMailboxInboundEmails())->up();
19+
(new \CreateMailboxInboundEmailsTable())->up();
2020
}
2121
}

0 commit comments

Comments
 (0)