1 | <?php |
||
5 | class ResourceRegistrar extends \Illuminate\Routing\ResourceRegistrar |
||
6 | { |
||
7 | /** |
||
8 | * The default actions for a resourceful controller. |
||
9 | * |
||
10 | * @var array |
||
11 | */ |
||
12 | protected $resourceDefaults = ['index', 'store', 'show', 'update', 'destroy']; |
||
13 | |||
14 | /** |
||
15 | * The default actions for each named resource relationship. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $relationshipDefaults = ['show']; |
||
20 | |||
21 | /** |
||
22 | * Create a new resource registrar instance. |
||
23 | * |
||
24 | * @param \Huntie\JsonApi\Routing\Router $router |
||
25 | */ |
||
26 | public function __construct(Router $router) |
||
30 | |||
31 | /** |
||
32 | * Route a resource to a controller. |
||
33 | * |
||
34 | * @param string $name |
||
35 | * @param string $controller |
||
36 | * @param array $options |
||
37 | */ |
||
38 | public function register($name, $controller, array $options = []) |
||
44 | |||
45 | /** |
||
46 | * Route any resource relationships to a controller. |
||
47 | * |
||
48 | * @param string $name |
||
49 | * @param string $controller |
||
50 | * @param array $options |
||
51 | */ |
||
52 | protected function registerRelationships($name, $controller, array $options) |
||
72 | |||
73 | /** |
||
74 | * Add a relationship show method to match named relationships on the resource. |
||
75 | * |
||
76 | * @param string $name |
||
77 | * @param string $base |
||
78 | * @param array $relationships |
||
79 | * @param string $controller |
||
80 | * @param array $options |
||
81 | * |
||
82 | * @return \Illuminate\Routing\Route |
||
83 | */ |
||
84 | protected function addRelationshipShow($name, $base, array $relationships, $controller, array $options) |
||
92 | |||
93 | /** |
||
94 | * Add a relationship update method to match named relationships on the resource. |
||
95 | * |
||
96 | * @param string $name |
||
97 | * @param string $base |
||
98 | * @param array $relationships |
||
99 | * @param string $controller |
||
100 | * @param array $options |
||
101 | * |
||
102 | * @return \Illuminate\Routing\Route |
||
103 | */ |
||
104 | protected function addRelationshipUpdate($name, $base, array $relationships, $controller, array $options) |
||
112 | |||
113 | /** |
||
114 | * Get the URI for resource relationships. |
||
115 | * |
||
116 | * @param string $name |
||
117 | * @param string $base |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | public function getRelationshipUri($name, $base) |
||
125 | |||
126 | /** |
||
127 | * Format a resource parameter for usage. |
||
128 | * |
||
129 | * @param string $value |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | public function getResourceWildcard($value) |
||
147 | } |
||
148 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: