backpack-for-laravel

GIF lose animation on upload

感情迁移 提交于 2021-01-28 13:50:49
问题 I have a project with Laravel 7.1 and Backpack and I lose the animation of the GIF images on upload. CRUD $this->crud->addField([ 'name' => 'photo', 'label' => 'Imagen ES', 'type' => 'image', 'upload' => false, 'prefix' => 'uploads/', ]); MODEL public function setPhotoAttribute($value){ $year = date('Y'); $attribute_name = "photo"; $disk = "uploads"; $destination_path = "/noticias/$year"; // if the image was erased if ($value==null) { // delete the image from disk \Storage::disk($disk)-

Filter table with a column in Laravel Backpack

懵懂的女人 提交于 2021-01-27 12:20:45
问题 I have a Employee table which display like this: +-------------------------------+ | id | name | code | --------------------------------- | 1 | Employee 1 | A1 | | 2 | Employee 2 | A2 | | ... | ... | ... | +-------------------------------+ And I want to create a filter by code column in this table. My query will be like this: SELECT name FROM employee WHERE code LIKE .% $filter %. I searched in backpack document and trying to do like this $this->crud->addFilter( [ 'type' => 'select2', 'name'

How to add custom js file to each page of specific entity CRUD in laravel-backpack

大兔子大兔子 提交于 2021-01-07 02:27:31
问题 I want to add a specific js file to a page of specific entity crud. (example: I want to add Tag-insert.js to the insert page of Tag crud) Is there any way to do this? 回答1: You could use a widget to insert custom javascript in the crud page. Check out the docs for widgets. Focus on after_scripts section. Example: you can create fooCrud.blade.php in resources/views/vendor/backpack/base/widgets that the blade file contains your custom javascript like this: @push('after_scripts') <script src="{{

Linking Spatie Permissions to Backpack UI show/hide

我只是一个虾纸丫 提交于 2021-01-05 07:08:01
问题 New to Laravel and Backpack here, but trying to integrate the PermissionManager with Backpack. I've got it all installed and showing the Users/Permissions/Roles in the UI, however I was unable to figure out how to show/hide buttons and functionality in the Backpack UI based on those permissions. I'm hoping someone can comment on the solution I came up with or if there is something else that should be used. Note, this is really about showing and hiding UI elements, not the actual policies

Linking Spatie Permissions to Backpack UI show/hide

心不动则不痛 提交于 2021-01-05 07:05:47
问题 New to Laravel and Backpack here, but trying to integrate the PermissionManager with Backpack. I've got it all installed and showing the Users/Permissions/Roles in the UI, however I was unable to figure out how to show/hide buttons and functionality in the Backpack UI based on those permissions. I'm hoping someone can comment on the solution I came up with or if there is something else that should be used. Note, this is really about showing and hiding UI elements, not the actual policies