Permalink
Branch: master
Find file Copy path
38e2a44 Jan 22, 2019
1 contributor

Users who have contributed to this file

24 lines (18 sloc) 480 Bytes
<?php
namespace BeyondCode\Mailbox\Routing;
use Illuminate\Support\Collection;
use BeyondCode\Mailbox\InboundEmail;
class RouteCollection
{
protected $routes = [];
public function add(Route $route)
{
$this->routes[] = $route;
}
public function match(InboundEmail $message): Collection
{
return Collection::make($this->routes)->filter(function ($route) use ($message) {
return $route->matches($message);
});
}
}