1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
namespace Illuminate\Database\Eloquent;
use Illuminate\Contracts\Queue\EntityNotFoundException; use Illuminate\Contracts\Queue\EntityResolver as EntityResolverContract;
class QueueEntityResolver implements EntityResolverContract { /** * Resolve the entity for the given ID. * * @param string $type * @param mixed $id * @return mixed * * @throws \Illuminate\Contracts\Queue\EntityNotFoundException */ public function resolve($type, $id) { $instance = (new $type)->find($id);
if ($instance) { return $instance; }
throw new EntityNotFoundException($type, $id); } }
|