Giter Club home page Giter Club logo

crud's People

Contributors

abbyjanke avatar dependabot-preview[bot] avatar dependabot[bot] avatar egyweb-mohamed avatar emanuelecoppola avatar frittenkeez avatar guleswine avatar jcastroa87 avatar jnoordsij avatar karandatwani92 avatar mahasadhu avatar makss avatar martijnb92 avatar maurohmartinez avatar mgralikowski avatar munjaldevelopment avatar olipayne avatar oliverziegler avatar onkbear avatar owenmelbz avatar phpfour avatar promatik avatar pxpm avatar se1exin avatar stylecibot avatar tabacitu avatar tswonke avatar vonsogt avatar zachweix avatar ziming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crud's Issues

provide demo resources

A few resources to help people get started / quickly create new files. Those resources should be stored in the plugin and published with the "demo" tag.

// publish demo resources:
// - Auto Models: Article, Category, Tag
// - Auto Requests: Article, Category, Tag
// - Auto Controllers: Crud/ArticleController, Crud/CategoryController, Crud/TagController
// - MANUAL routes
// - MANUAL migration for those entities

PDO support

QueryException in Connection.php line 713:
SQLSTATE[HY000]: General error: 1 near "SHOW": syntax error (SQL: SHOW COLUMNS FROM tags)

change line DB::raw('SHOW COLUMNS FROM in
/vendor/backpack/crud/src/PanelTraits/AutoSet.php and /vendor/backpack/crud/src/CrudTrait.php with
Schema::hasColumn( string $table, string $column)
all shema method please refer to documentation /Illuminate/Database/Schema/Builder

thank you

[Feature][3.4][WIP] Clone operation

Alongside the regular buttons, there should be a Clone button, in this order: Edit | Clone | Delete

Behaviour:

  • clicking the clone button will open an "Add item" view, with the previous item's information already populated in the fields;
  • this way, by showing everything in the "Add item" view:
    • the user can quickly modify what needs to be changed (most used case);
    • any validations will show up nicely and can be easily resolved (ex: slug is unique);

Details:

  • this will require a new "access" variable, "clone", which by default is missing; only by giving $this->crud->allowAccess('clone') will the button show up and functionality work;

crud 3.0.0 update errors

I have the followings in my composer.json

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "backpack/base": "^0.6.6",
    "backpack/crud": "^3.0.0",
    "backpack/generators": "^1.1",
    "backpack/langfilemanager": "^1.0",
    "backpack/backupmanager": "^1.1",
    "backpack/settings": "^2.0",
    "backpack/pagemanager": "^1.0"
},

And I run composer update, then I get the following errors.

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- backpack/settings 2.0.5 requires backpack/crud 2.* -> satisfiable by backpack/crud[2.0.0, 2.0.1, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.0.15, 2.0.16, 2.0.17, 2.0.18, 2.0.19, 2.0.2, 2.0.20, 2.0.21, 2.0.22, 2.0.23, 2.0.24, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, v2.x-dev] but these conflict with your requirements or minimum-stability.
- backpack/settings 2.0.4 requires backpack/crud 2.* -> satisfiable by backpack/crud[2.0.0, 2.0.1, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.0.15, 2.0.16, 2.0.17, 2.0.18, 2.0.19, 2.0.2, 2.0.20, 2.0.21, 2.0.22, 2.0.23, 2.0.24, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, v2.x-dev] but these conflict with your requirements or minimum-stability.
- backpack/settings 2.0.3 requires backpack/crud 2.* -> satisfiable by backpack/crud[2.0.0, 2.0.1, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.0.15, 2.0.16, 2.0.17, 2.0.18, 2.0.19, 2.0.2, 2.0.20, 2.0.21, 2.0.22, 2.0.23, 2.0.24, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, v2.x-dev] but these conflict with your requirements or minimum-stability.
- backpack/settings 2.0.2 requires backpack/crud 2.* -> satisfiable by backpack/crud[2.0.0, 2.0.1, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.0.15, 2.0.16, 2.0.17, 2.0.18, 2.0.19, 2.0.2, 2.0.20, 2.0.21, 2.0.22, 2.0.23, 2.0.24, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, v2.x-dev] but these conflict with your requirements or minimum-stability.
- backpack/settings 2.0.1 requires backpack/crud 2.* -> satisfiable by backpack/crud[2.0.0, 2.0.1, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.0.15, 2.0.16, 2.0.17, 2.0.18, 2.0.19, 2.0.2, 2.0.20, 2.0.21, 2.0.22, 2.0.23, 2.0.24, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, v2.x-dev] but these conflict with your requirements or minimum-stability.
- backpack/settings 2.0.0 requires backpack/crud 0.* -> satisfiable by backpack/crud[0.4.1, 0.5.0, 0.5.1, 0.5.10, 0.5.9, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.7.7, 0.7.8, 0.7.9, 0.8.0, 0.8.1, 0.8.10, 0.8.11, 0.8.12, 0.8.13, 0.8.14, 0.8.15, 0.8.16, 0.8.17, 0.8.18, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.8.8, 0.8.9, 0.9.0, 0.9.1, 0.9.10, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9] but these conflict with your requirements or minimum-stability.
- backpack/settings 2.0.4 requires backpack/crud 2.* -> satisfiable by backpack/crud[2.0.0, 2.0.1, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.0.15, 2.0.16, 2.0.17, 2.0.18, 2.0.19, 2.0.2, 2.0.20, 2.0.21, 2.0.22, 2.0.23, 2.0.24, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, v2.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for backpack/settings ^2.0 -> satisfiable by backpack/settings[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5].

Column types: date amd datetime

Pretty date/datetime columns should be easier to do. Having column types for that will make it so.

We should use the jenssegers/date package, so dates are automatically translated to the admin panel language.

The should also have the datatables-specific attribute, which allows accurate sorting of formatted dates.

@cristiantone?

Field type: array

  • The value is stored as a json in the db: {"a":1,"b":2,"c":3,"d":4,"e":5};
  • The user can add/edit/remove multiple array entries;
  • The entries are stored in a hidden input, then saved to the db;
  • The field should probably look something like this:

================= [ - remove ]
================= [ - remove ]
================= [ - remove ]
[ + add new item ]

It would work GREAT with the new 'array' column type.

Possible issues:

  • what if the user only edits this, then does not focus out of the field and just clicks "save"? maybe the hidden input should be saved on each key stroke...

[COLUMNS] setColumnOrder()

Make this work:
$this->crud->setColumnOrder(['column_1', 'column_2', 'column_3']);

The sorting functionality in the Crud.php file does not work.
Also, I don't think the $crud->sort property makes no sense now.
The sorting should just shuffle the arrays where they are, without storing the order anywhere.

Browse field type and wrong iframe URL to elFinder

The browse field type works fine when Laravel is installed in a root folder, but not when the site is located in a subfolder.

Example:

On http://localhost/ the URL of the browse iframe point correctly to elFinder popup layout.
On http://localhost/MySite/public/ the URL is /admin/elfinder/popup/image-filemanager instead of /MySite/public/admin/elfinder/popup/image-filemanager

Validation errors do not show

Simptoms: everything looks fine in the controller, model, request, but validation errors DO NOT SHOW; After validation (which does happen), you are redirected back to the create/edit page, but without showing any errors and with emptied fields.

If you happen to spend A LOT of time trying to figure out, here it is:

  • in your routes.php file, make sure your CRUD panel is not behind the web middleware.

That's it.

Custom Primary Keys?

I may be missing something, but it looks like the crud library does not take in to account a defined $primaryKey = 'my_id'; in your models?

Looking in list.blade.php and some other areas I see items like {{ Request::url().'/'.$entry->id }} that seem fixed to the 'id' convention.

[FIELDS] If "required" show asterisk.

  1. In all fields, if the "required" attribute is true, show an asterisk to let the user know the field is mandatory.
  2. In Crud.php, the following functions should be completed:
    • $this->crud->setRequiredFields(['field_1', 'field_2'], 'update/create/both');
    • $this->crud->setRequiredField('field_1', 'update/create/both');
    • $this->crud->getRequiredFields()

Checkbox for checkbox field in table view?

What would you think about showing a checkbox field in the list table view, as a checkbox vs 1/0? (Not sure the direction you might be going on these, so didn't want to just create a pull request.)

I'm using this, around line 90 in list.blade.php, myself:

@elseif (isset($column['type']) && $column['type']=='checkbox')   
    {{-- checkbox with loose false/null/0 checking --}}
    <td><input type="checkbox"
        @unless(strip_tags($entry->{$column['name']}) == false)
            checked = "checked"
        @endunless
    ></td>

PS. Started using backpack pretty heavily on a new project -- thanks so much for creating this, and making it so flexible!

@extends('backpack::layout')

This is my Error
How to fix this.. Please help me

No hint path defined for [backpack]. (View: C:\wamp\www\partner\resources\views\vendor\elfinder\elfinder.blade.php)

Column type: check

A column for booleans, which shows a checkbox favicon, checked or not, depending on the value.

Should use the included font awesome.

Ref #61

Datatable & CRUD Translation

I want to translate Datatable to Lao, so i duplicated "resources/lang/vendor/backpack/en" to "lo", i can translate:

// Create form
'add' => 'ເພີ່ມ',
'back_to_all' => 'ກັບຄືນສູ່ລາຍການ ',
'cancel' => 'ຍົກເລີກ',
'add_a_new' => 'ເພີ່ມ ',

    // Create form - advanced options
    'after_saving'            => 'ຫຼັງຈາກບັນທຶກ',
    'go_to_the_table_view'    => 'ໄປທີ່ລາຍການທັງໝົດ',
    'let_me_add_another_item' => 'ເພີ່ມລາຍການໃໝ່ອີກ',
    'edit_the_new_item'       => 'ແກ້ໄຂລາຍການທີ່ເພີ່ມ',

// Edit form
'edit'                 => 'ແກ້ໄຂ',
'save'                 => 'ບັນທຶກ',

but below comment "// DataTables translation" are not effected, it is still show in English

Please help, Thanks

[EDITION] select2 fields doesn't works on edit view

I have an Article model that have an author field (user_id).
In my ArticleCrudController, I add the followed field:

$this->crud->addField([
        'label' => 'Author 
        'type' => 'select2',
        'name' => 'user_id',
        'entity' => 'user',
        'attribute' => 'name',
        'model' => User::class
    ], 'both');

It works fine on create view, but completely not on edit view.
Instead of my select2 field, I see a number field, and it's broken because of this error:

htmlentities() expects parameter 1 to be string, array given. 

Located in number.blade.php.

Custom buttons

Developers should be able to add custom buttons. Proposed syntax:

$this->crud->addButton('button_name', 'model_function_name'); 
// by default this will place the button before edit and delete
// ex: $this->crud->addButton('send_email', 'getSendEmailButton');

// other methods:
$this->crud->removeButton('send_email');
$this->crud->setButtonsOrder(['edit', 'send_email', 'delete']);

This way, I think, we'll leave a lot of space for customization. On your model, you could do something like:

public function getSendEmailButton() {
    return "<a class='btn btn-warning' href='some_link'><i class='fa fa-envelope'> Send email</a>"; 
}

and you can have your checks or complex logic there. Ex:

  • show the button to some users and others not.
  • show the button for some entries and others not.
  • show different url depending on some model attribute.
  • etc.

What I don't like about this is that it does imply you'll be writing some HTML in the model, which is a bit ugly... What do you think? Any better solutions?

Note: I also see the need for custom bulk buttons in the future. But that's another topic.

[FIELDS] setFieldOrder()

The programmer should have the ability to choose the order the fields, after the fact.

This function in Crud.php should be completed:
$this->crud->setFieldOrder(['field_1', 'field_2', 'field_3'], 'update/create/both');

can i use crud to upload image ?

Hello
i need to make input file to upload image file and save file name to database table

i need to rename file name before save the file name in DB

any suggestions?

Thank you in advance

A little more complex setEntityNameStrings

I was thinking maybe we can do a better version of this function to add two options. This feature seems to be necesary when:

  • we translate the text in languages that have different terms for "all" depending on the gender of the term.
  • we translate the articulated version of a keword that has more than one word.
    Though i am not sure that there is another language, besides the romanian one, that needs this kind of features.

Pagination using AJAX

Is this considered?
Right now all rows are queried.

With thousands of rows and custom columns? this might get pretty heavy...

Use FormField classes for better API and reduce redundant code

Right now a lot of field types have the same template, but only the type="text | date | email " is different.

If you want to change the layout of the fields, you need to override a lot of templates (for example if you want a .form-horizontal).

What about something like this:

$fields = new FieldList(
    new EmailField('email', 'Email'),
    new DropdownField('status', 'Status', ['yes', 'no']),
    new TextField('name', 'Name') // 'Name' optional, so it will be taken from 'name'
);

instead of

$fields = [
    [
        'type'  => 'email',
        'label' => 'Email',
        'name'  => 'email',
    ],
    [
        'type'  => 'select',
        'label' => 'Status',
        'name'  => 'status',
        'options' => ['yes', 'no']
    ],
    [
        'type'  => 'text',
        'label' => 'Name',
        'name'  => 'name',
    ]

];

For the EmailField you don't need a seperate template and the API for the Dropdown Field is perfeclty clear without need to refer to documenation when you have something like this (quick boiler plating) :

class DropdownField extends FormField
{
    protected $options = [];

    protected $type = 'select';

    public function __construct($name, $label, $options)
    {
        $this->options = $options;

        parent::__construct($name, $label);
    }
}

class EmailField extends TextField
{
    protected $type = 'email';
}

class TextField extends FormField
{
    public function view()
    {
        return view('fields.' . $this->template, ['field' => $this]);
    }
}

abstract class FormField
{
    protected $name;

    protected $label;

    protected $attributes = [];

    protected $classes = [
        'holder' => ['form-group'],
        'label'  => ['control-label'],
        'field'  => ['form-control'],
    ];

    protected $template = 'text';

    protected $type = 'text';

    public function __construct($name, $label)
    {
        $this->name  = $name;
        $this->label = $label;
    }

    public function setAttribute($attr, $value)
    {
        $this->attributesp[$attr] = $value;
        return $this;
    }

    public function addClass($class, $target = 'field') // ? field and holder?
    {
        $this->classes[$target][] = $class;
        return $this;
    }

Install Problem

I am receiving this error and do not know how to fix it.

Invalid backend configuration.
Readable volumes not available.

Help please

Thanks

UX: Inline error messages

Maybe errors should be placed inline, for each field, while highlighting it. The register form already has a standard implementation of this:

<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
                            <label class="col-md-4 control-label">{{ trans('backpack::base.name') }}</label>

                            <div class="col-md-6">
                                <input type="text" class="form-control" name="name" value="{{ old('name') }}">

                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('name') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

That way:

  • we can just show a pnotify bubble in the top-right corner saying "Please fix the errors" and we can hide the error bubble we show now => consistent errors across the platform;
  • we improve usability (especially for long forms, when you can forget what fields you missed and have to go back to the top to see, then back down to the field to complete it, etc;

where's Callback after ,before insert,update etc

Hello!
am trying to use this package but it does not support edit like grocery crud

there are not Callbacks of after ,before insert,update ,delete etc

i tryed for example to rename file for elfinder but i can not i have been searching for 4-5 days

even i tried to make custom field image but with no luck

there's no callback available to make more control of coding

please try to add callback or we wont be able to edit or change code for our needs

thank you in advance

Field definition should include field size and separate html attributes

Aurel Drăguţ came with a great idea in order to allow developers to build 2-column layouts, 3-column layouts, etc in their forms.

Just by allowing the developer to place an extra class on the parent form element

<div class='form-group'>

we would be able to easily build panels that look like this:
screen shot 2016-06-09 at 09 57 50

This would imply a certain syntax change, so the change should come at the same with @cristiantone 's proposition to separate the HTML attributes sent to the input/textarea/select/etc.

Here's the new proposed syntax for the "text" field type:

$this->crud->addFields([
  // mandatory
  'name' => 'name',
  'type' => 'text',
  'label' => 'Name',
  // optional
  'optionalAttributes' => [
    'disabled' => 'disabled',
    'style' => 'border: 1px solid red',
    ...
  ],
  'parentAttributes' => [
     'class' => 'col-md-6',
     'style' => 'border-top: 1px solid #eee; margin-top: 10px;'
  ]
]);

@Ghitu , @cristiantone , @mariusconstantin2503 , what do you think?

[Field Type] addClause on select, select2, select_multiple, select2_multiple, checklist, checklist_dependency

@AurelDragut made an interesting suggestion: at some point, we'll definitely need to filter the results in these 1-n and n-n fields.

Say:

  • only show moderators, not all users
  • only show trashed items
  • only show products that are under 50$
    etc.

I see one way to do this right now:

  • creating a new model that extends the old one and overwrites the "all" method to restrict the query;

But... it's not pretty... Should we do something about this? What better ways do you see to solve this?

Thanks, cheers!

select_multiple works, select2_multiple don't

When I try to use a select2_multiple field instead of a select_multiple field, I get this error:

ErrorException in b58d2ac85e3cfb89e50920aa215a69bd96d9acac.php line 25: Array to string conversion (View: D:\Progetti\instalmec.it\Instalmec\vendor\backpack\crud\src\resources\views\fields\select2_multiple.blade.php) (View: D:\Progetti\instalmec.it\Instalmec\vendor\backpack\crud\src\resources\views\fields\select2_multiple.blade.php) (View: D:\Progetti\instalmec.it\Instalmec\vendor\backpack\crud\src\resources\views\fields\select2_multiple.blade.php)

I changed nothing else the field type, from select_multiple to select2_multiple

[COLUMNS] Extendable column types.

There's no reason why the column types should be limited to what the CRUD provides.
The programmer should be allowed to define his own column type.

Laravel 5.1 support

@FarhadMohammadi and a few others have asked about Backpack working on Laravel 5.1.

I haven't actually given any thought to making it work on Laravel 5.1, since I believe the LTS tag is BS - I have projects with 5.1 bugs that still have not been fixed, though reported, but upgrading to Laravel 5.2 fixes them.

I guess the only difference to make it work on 5.1 would be Middleware Groups.

I personally have no need for Backpack to work on Laravel 5.1, so there's no immediate plan to support it, but if someone puts in the effort, I'm more than happy to help and merge it.

UX: Persistent "let me add another item"

In the create form, when a user chooses to "let me add another item" at the end of the form, don't only redirect him to the create form, also make sure this time the "let me add another item" radio is checked, because most of the time that's what he'll want.

This can be done in two ways:

  1. a cookie (which would also affect other create forms);
  2. a GET parameter;

I tend to think option no 2 is better.

This enhancement, combined with #72 and #71 will greatly improve the create form usability.

Configurable number of rows in list view

You should be able to choose the default number of rows on a given CRUD panel. This is easily done by adding "pageLength": 50, to list.blade.php when the DataTable is instantiated.

Proposed syntax:

$this->crud->setDefaultListSize(50);

SublimeText plugin/snippets

One thing we could do to speed up development is NOT going to the documentation website every time we need the syntax for a certain field type.

A SublimeText plugin/collection of snippets will solve that problem for me. Here's the syntax I have in mind:

crud.addField.select_multiple 

=>

$this->crud->addField([       // SelectMultiple = n-n relationship (with pivot table)
    'label' => "Tags",
    'type' => 'select_multiple',
    'name' => 'tags', // the method that defines the relationship in your Model
    'entity' => 'tags', // the method that defines the relationship in your Model
    'attribute' => 'name', // foreign key attribute that is shown to user
    'model' => "App\Models\Tag", // foreign key model
    'pivot' => true, // on create&update, do you need to add/delete pivot table entries?
]);

I'm thinking an alternative shorter syntax will also be available:

crud.af.select_multiple

What I want from the syntax is for it to still read the same as the code you want to write, so it will be easy to remember:

  • $this->crud->addField() - reads crud add field
  • crud.addField.select_multiple - reads crud add field select multiple
  • crud.af.select_multiple - reads crud add field select multiple

Using the crud prefix would allow us to also do things like:

// addColumn
crud.ac.column_type => [column definition]
// removeColumn
crud.rc => $this->crud->removeColumn('column_name');
// removeField
crud.rf => $this->crud->removeField('name', 'update/create/both);
// allowAccess
crud.aa => $this->crud->allowAccess(['list', 'create', 'update', 'reorder', 'delete']);
// denyAccess
crud.da => $this->crud->denyAccess(['list', 'create', 'update', 'reorder', 'delete']);
// enableDetailsRow
crud.edr =>
  $this->crud->enableDetailsRow();
  $this->crud->allowAccess('details_row');
  // NOTE: you also need to do overwrite the showDetailsRow($id) method in your EntityCrudController to show whatever you'd like in the details row OR overwrite the views/backpack/crud/details_row.blade.php
// addClause
crud.addClause => $this->crud->addClause('where', 'name', '==', 'car');

Any thoughts / improvements?

[BUTTONS] Ability to add/remove buttons from the crud table view.

  1. The are some functions already in Crud.php, which may or may not be ok. They need to be checked, commented, documented and moved to the correct location in the Crud.php document.
  2. The views do NOT respect the way the CRUD works in this sense - they just show the default buttons. They should be edited to show the buttons defined in the CRUD.

[Feature req][3.4] Custom bulk buttons

In the future, I foresee the need of checkboxes in the first table column and having bulk buttons at the top/bottom of the table, for bulk actions.

screen shot 2016-06-15 at 18 39 34
crude screenshot

This is the proposed syntax for that:

$this->crud->addBulkButton('name', 'url_to_send_a_post_request_with_their_ids');
$this->crud->setBulkButtonsOrder(['send_email', 'delete']);

Any better solutions?

Split the Crud.php class

The class has become way too big. Let's split it up. Look at the cohesion graph:
render

I'd say it's ok to split it in:

  • Crud.php
  • ButtonsTrait.php
  • AccessTrait.php
  • ColumnsTrait.php
  • FieldsTrait.php
  • EntityTrait.php (set name, save, sync, update, delete)?
  • ReorderTrait.php
  • FakeFieldsTrait.php
  • FakeColumnsTrait.php

Any better ideas?

Attribute Casting causes error

Hi, I use eloquent attribute casting and I have
protected $casts = [ 'mentions' => 'array', ];

in my model. It causes

ErrorException in 90d0d21803ea756d9c9e49ba82191f0eef2d2e2d.php line 97: strip_tags() expects parameter 1 to be string, array given (View: ......\vendor\backpack\crud\src\resources\views\list.blade.php)

error when I hit the admin/somecrudpage .If I remove $casts, there is no problem. So, I think Backpack/Crud needs to support eloquent attribute casting.
I will be happy if you help me to makeshift for this issue because I have a project to done. Or I prefer if you commit for solving this problem :)

Is setFromDB method will be kept in the future?

I've some issues with setFromDB method, specially on edit views with relations fields.
I'm ok to try to fix them, but I want to know if the setFromDB method will be kept in the future, or if you want to delete it, in benefit to manually addField methods

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.