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:
Chris Thompson committed 2019-11-12 20:02:04 -05:00
1 parent bcc317d21a
commit 6906174183
1 file changed
+1 -1
+1 -1
View File
@@ -1201,7 +1201,7 @@ class FormBuilder
protected function getRouteAction($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);