Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Mar 10, 2021
2 parents e6ecf7e + f73c9bc commit 88981f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
<script src="https://unpkg.com/filepond-plugin-image-transform/dist/filepond-plugin-image-transform.js"></script>
@endpushonce

@php
$formComponent->placeholder = __($formComponent->placeholder);
@endphp

<x-forms::field-group
:column-span="$formComponent->columnSpan"
:error-key="$formComponent->name"
Expand All @@ -65,13 +61,13 @@
FilePond.registerPlugin(FilePondPluginImageTransform)
let config = {
acceptedFileTypes: {{ json_encode($formComponent->acceptedFileTypes) }},
acceptedFileTypes: @json($formComponent->acceptedFileTypes),
files: [],
{{ $formComponent->imageCropAspectRatio !== null ? "imageCropAspectRatio: '{$formComponent->imageCropAspectRatio}'," : null }}
{{ $formComponent->imagePreviewHeight !== null ? "imagePreviewHeight: {$formComponent->imagePreviewHeight}," : null }}
{{ $formComponent->imageResizeTargetHeight !== null ? "imageResizeTargetHeight: {$formComponent->imageResizeTargetHeight}," : null }}
{{ $formComponent->imageResizeTargetWidth !== null ? "imageResizeTargetWidth: {$formComponent->imageResizeTargetWidth}," : null }}
{{ $formComponent->placeholder !== null ? "labelIdle: '{$formComponent->placeholder} KB'," : null }}
{{ __($formComponent->placeholder) !== null ? 'labelIdle: \'' . __($formComponent->placeholder) . '\',' : null }}
{{ $formComponent->maxSize !== null ? "maxFileSize: '{$formComponent->maxSize} KB'," : null }}
{{ $formComponent->minSize !== null ? "minFileSize: '{$formComponent->minSize} KB'," : null }}
server: {
Expand Down
6 changes: 5 additions & 1 deletion src/Resources/Pages/EditRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ public function isAuthorized()

public function mount($record)
{
$this->record = static::getModel()::findOrFail($record);
$model = static::getModel();

$routeKeyName = (new $model())->getRouteKeyName();

$this->record = $model::where($routeKeyName, $record)->firstOrFail();
}

public function save()
Expand Down

0 comments on commit 88981f8

Please sign in to comment.