Skip to content

Commit c0295e8

Browse files
authored
Remove modelUrl method and update URL handling
1 parent 1842f55 commit c0295e8

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/Fields/Repeater.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,6 @@ public function buildOption(Request $request, Model $model): array
204204
return $option;
205205
}
206206

207-
/**
208-
* Get the model URL.
209-
*/
210-
public function modelUrl(Model $model): string
211-
{
212-
$key = $model->exists ? (string) $model->getKey() : 'create';
213-
214-
return str_replace('{resourceModel}', $key, $this->getUri());
215-
}
216-
217207
/**
218208
* {@inheritdoc}
219209
*/
@@ -281,7 +271,7 @@ public function toInput(Request $request, Model $model): array
281271
'html' => View::make('root::fields.repeater-option', $option)->render(),
282272
]);
283273
}, $this->resolveOptions($request, $model)),
284-
'url' => $this->modelUrl($model),
274+
'url' => $this->replaceRoutePlaceholders($request->route()),
285275
]);
286276
}
287277

0 commit comments

Comments
 (0)