File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 5
5
use Illuminate \Support \Facades \Route ;
6
6
use BeyondCode \Mailbox \Routing \Router ;
7
7
use Illuminate \Support \ServiceProvider ;
8
+ use BeyondCode \Mailbox \Facades \Mailbox ;
8
9
use BeyondCode \Mailbox \Http \Middleware \MailboxBasicAuthentication ;
9
10
10
11
class MailboxServiceProvider extends ServiceProvider
@@ -43,10 +44,14 @@ public function register()
43
44
$ this ->app ->singleton ('mailbox ' , function () {
44
45
return new Router ($ this ->app );
45
46
});
47
+
48
+ $ this ->app ->singleton (MailboxManager::class, function () {
49
+ return new MailboxManager ($ this ->app );
50
+ });
46
51
}
47
52
48
53
protected function registerDriver ()
49
54
{
50
- ( new MailboxManager ( $ this -> app ))-> mailbox ()->register ();
55
+ Mailbox:: mailbox ()->register ();
51
56
}
52
57
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace BeyondCode \Mailbox \Routing ;
4
4
5
+ use BeyondCode \Mailbox \MailboxManager ;
5
6
use Illuminate \Support \Collection ;
6
7
use Illuminate \Container \Container ;
7
8
use BeyondCode \Mailbox \InboundEmail ;
9
+ use Illuminate \Support \Traits \ForwardsCalls ;
8
10
9
11
class Router
10
12
{
13
+ use ForwardsCalls;
14
+
11
15
/** @var RouteCollection */
12
16
protected $ routes ;
13
17
@@ -109,4 +113,11 @@ protected function storeEmail(InboundEmail $email)
109
113
{
110
114
$ email ->save ();
111
115
}
116
+
117
+ public function __call ($ method , $ parameters )
118
+ {
119
+ return $ this ->forwardCallTo (
120
+ $ this ->container ->make (MailboxManager::class), $ method , $ parameters
121
+ );
122
+ }
112
123
}
You can’t perform that action at this time.
0 commit comments