code refactoring with @cuneytsenturk after dropzone improvement
This commit is contained in:
parent
8c84d0cf80
commit
05d19c435d
@ -32,7 +32,7 @@
|
||||
|
||||
{{ Form::textareaGroup('address', trans('general.address')) }}
|
||||
|
||||
{{ Form::fileGroup('logo', trans('companies.logo'), '', ['dropzone-class' => 'form-file']) }}
|
||||
{{ Form::fileGroup('logo', trans('companies.logo'), '', ['dropzone-class' => 'form-file'], $company->company_logo) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), $company->enabled) }}
|
||||
</div>
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item']) }}
|
||||
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file']) }}
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file'], $item->picture) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), $item->enabled) }}
|
||||
</div>
|
||||
|
@ -37,20 +37,35 @@
|
||||
@endif
|
||||
|
||||
@if (!empty($value))
|
||||
@php
|
||||
$attachments = [];
|
||||
@endphp
|
||||
|
||||
@if (is_array($value))
|
||||
@foreach($value as $attachment)
|
||||
@php
|
||||
$attachments[] = ['name' => $attachment->filename . '.' . $attachment->extension, 'path' => route('uploads.get', $attachment->id), 'downloadPath' => route('uploads.download', $attachment->id)];
|
||||
$attachments[] = [
|
||||
'name' => $attachment->filename . '.' . $attachment->extension,
|
||||
'path' => route('uploads.get', $attachment->id),
|
||||
'downloadPath' => route('uploads.download', $attachment->id)
|
||||
];
|
||||
@endphp
|
||||
@endforeach
|
||||
@elseif ($value instanceof \Plank\Mediable\Media)
|
||||
@php
|
||||
$attachments = ['name' => $value->filename . '.' . $value->extension, 'path' => route('uploads.get', $value->id)];
|
||||
$attachments = array($attachments);
|
||||
$attachments[] = [
|
||||
'name' => $value->filename . '.' . $value->extension,
|
||||
'path' => route('uploads.get', $value->id)
|
||||
];
|
||||
@endphp
|
||||
@else
|
||||
@php
|
||||
$attachments = array();
|
||||
$attachment = \Plank\Mediable\Media::find($value);
|
||||
|
||||
$attachments[] = [
|
||||
'name' => $attachment->filename . '.' . $attachment->extension,
|
||||
'path' => route('uploads.get', $attachment->id)
|
||||
];
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user