Fixes a bug where passed to route() causes errors
This attempts to fix #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]]) }} ```
This commit is contained in:
1 parent
bcc317d21a
commit
6906174183
1 file changed
+1
-1
+1
-1
@@ -1201,7 +1201,7 @@ class FormBuilder
|
|||||||
protected function getRouteAction($options)
|
protected function getRouteAction($options)
|
||||||
{
|
{
|
||||||
if (is_array($options)) {
|
if (is_array($options)) {
|
||||||
return $this->url->route($options[0], array_slice($options, 1));
|
return $this->url->route($options[0], head(array_slice($options, 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->url->route($options);
|
return $this->url->route($options);
|
||||||
|
|||||||
Reference in new issue
Block a user