Skip to content

Commit 6906174

Browse files
author
Chris Thompson
committed
Fixes a bug where passed to route() causes errors
This attempts to fix LaravelCollective#510 even though the example provided by @zsoltgyure isn't actually using route model binding. This bugfix was tested and works with the following. Non-route model binding: ``` {{ Form::open(['route' => ['mytest', [$file->id]]]) }} ``` Another non-route model binding: ``` {{ Form::open(['route' => ['mytest', $file->id]]) }} ``` Multiple models into route model binding: ``` {{ Form::open(['route' => ['manage.files.delete', [$currentPodcast, $file]]]) }} ``` Single model into route model binding: ``` {{ Form::open(['route' => ['manage.podcast.delete', $currentPodcast]]) }} ```
1 parent bcc317d commit 6906174

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FormBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ protected function getUrlAction($options)
12011201
protected function getRouteAction($options)
12021202
{
12031203
if (is_array($options)) {
1204-
return $this->url->route($options[0], array_slice($options, 1));
1204+
return $this->url->route($options[0], head(array_slice($options, 1)));
12051205
}
12061206

12071207
return $this->url->route($options);

0 commit comments

Comments
 (0)