@@ -320,19 +320,9 @@ public function formatScheme($secure = null)
320
320
*/
321
321
public function signedRoute ($ name , $ parameters = [], $ expiration = null , $ absolute = true )
322
322
{
323
- $ parameters = $ this ->formatParameters ($ parameters );
324
-
325
- if (array_key_exists ('signature ' , $ parameters )) {
326
- throw new InvalidArgumentException (
327
- '"Signature" is a reserved parameter when generating signed routes. Please rename your route parameter. '
328
- );
329
- }
330
-
331
- if (array_key_exists ('expires ' , $ parameters )) {
332
- throw new InvalidArgumentException (
333
- '"Expires" is a reserved parameter when generating signed routes. Please rename your route parameter. '
334
- );
335
- }
323
+ $ this ->ensureSignedRouteParametersAreNotReserved (
324
+ $ parameters = $ this ->formatParameters ($ parameters )
325
+ );
336
326
337
327
if ($ expiration ) {
338
328
$ parameters = $ parameters + ['expires ' => $ this ->availableAt ($ expiration )];
@@ -347,6 +337,27 @@ public function signedRoute($name, $parameters = [], $expiration = null, $absolu
347
337
], $ absolute );
348
338
}
349
339
340
+ /**
341
+ * Ensure the given signed route parameters are not reserved.
342
+ *
343
+ * @param mixed $parameters
344
+ * @return void
345
+ */
346
+ protected function ensureSignedRouteParametersAreNotReserved ($ parameters )
347
+ {
348
+ if (array_key_exists ('signature ' , $ parameters )) {
349
+ throw new InvalidArgumentException (
350
+ '"Signature" is a reserved parameter when generating signed routes. Please rename your route parameter. '
351
+ );
352
+ }
353
+
354
+ if (array_key_exists ('expires ' , $ parameters )) {
355
+ throw new InvalidArgumentException (
356
+ '"Expires" is a reserved parameter when generating signed routes. Please rename your route parameter. '
357
+ );
358
+ }
359
+ }
360
+
350
361
/**
351
362
* Create a temporary signed route URL for a named route.
352
363
*
0 commit comments