Created
February 10, 2018 21:27
-
-
Save NBZ4live/398e2bb2df0d9a0872c0dcca4b76cb01 to your computer and use it in GitHub Desktop.
Laravel backpack clone button. (resources/views/vendor/backpack/crud/buttons/custom/clone.blade.php)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if ($crud->hasAccess('create')) | |
@php($parameters = []) | |
@php($attributes = collect($entry->getAttributes())) | |
@foreach($crud->getFields('create') as $field) | |
@if($attributes->has($field['name'])) | |
@php($parameters[$field['name']] = $attributes->get($field['name'])) | |
@endif | |
@endforeach | |
<a href="{{ url($crud->route.'/create') . '?' . http_build_query($parameters) }}" class="btn btn-xs btn-default"> | |
<i class="fa fa-clone"></i> {{ trans('backpack::crud.clone') }} | |
</a> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment