Released by Dcat Admin v1.5.0, it is a high value background system building tool, adding cool dark mode theme

Posted by misty on Mon, 15 Jun 2020 06:27:10 +0200

Dcat Admin

Dcat Admin Is based on laravel-admin The second development of the background system construction tool, only a small amount of code can quickly build a functional high value background system. Built in rich back-end common components, out of the box, let developers bid farewell to miscellaneous HTML code, very friendly to back-end developers.

Online demo site | Official documents | Github home (if you like this project, you can click star. Thank you for your support! )

v1.5.0 update

What's new

1. Dark mode

Dark mode theme has been added in this version, which supports switching and saving status through page buttons. Please refer to the document for specific use Theme - Dark mode


2. Asynchronous loading of table modal and expand

Define rendering class, inherit Dcat\Admin\Support\LazyRenderable

use App\Models\Post as PostModel;
use Dcat\Admin\Support\LazyRenderable;
use Dcat\Admin\Widgets\Table;

class Post extends LazyRenderable
{
    public function render()
    {
        // Get ID
        $id = $this->key;
        
        // Get other custom parameters
        $type = $this->post_type;

        // Find data
        $data = PostModel::where('user_id', $id)
            ->where('type', $type)
            ->get(['title', 'body', 'body', 'created_at'])
            ->toArray();

        $titles = ['User ID', 'Title', 'Body', 'Created At'];

        // Rendering
        return Table::make($titles, $data);
    }
}

use

$grid->column('post')->modal('Post', Post::make(['post_type' => 2]));

Please refer to the document for specific use Display of table columns - modal as well as Display of table columns - modal

<img  src="https://cdn.learnku.com/uploads/images/202006/14/38389/KMHagem4OZ.gif!large" style="box-shadow:0 1px 6px 1px rgba(0, 0, 0, 0.12)" width="100%">

<img  src="https://cdn.learnku.com/uploads/images/202006/14/38389/DvvyZUTXpG.gif!large" style="box-shadow:0 1px 6px 1px rgba(0, 0, 0, 0.12)" width="100%">

3. Add file upload interface to tool form

Starting from this version, using the file / image upload form in the tool form does not require a user-defined upload interface. The file will be uploaded to the predefined interface of the system by default for processing.

use Dcat\Admin\Widgets\Form;

class MyForm extends Form
{
    public function form()
    {
        // No need to customize the upload interface, you can use it directly
        $this->image('logo');
        
        ...
    }
    
    ...
}

4. Quick creation of forms add hidden forms

$grid->quickCreate(function ($quick) {
    $quick->hidden('column_name')->value(...);
    
    ...
});

5. Pop up selector, editor, markdown and other forms support one to many forms

$form->hasMany('posts', function ($form) {
    $form->selectResource('attribute')->path('...')->options(...);
    
    $form->editor('description');
    
    $form->markdown('remark');
    
    ...
});

6. File upload form save file domain name to data table

In this version, the domain name of the file can be saved to the data table through the saveFullUrl method

$form->image('...')->saveFullUrl();

$form->file('...')->saveFullUrl();

Optimization function part

1. Automatically remove the modal mask layer when refreshing the page

Starting with this version, you can remove the following code when using the tool form pop-up

Admin::script('Dcat.onPjaxComplete(function () {
    $(".modal-backdrop").remove();
    $("body").removeClass("modal-open");
}, true)');

2. Optimization of exception handling function

The bottom interface of exception handling is optimized, and trace message can be displayed on the error page

3. Page detail style optimization

In this version, we have optimized many detail styles to make the whole more harmonious and beautiful

4. Add prefix to form field class

Conflicts between css class and compatible part of special field names #190

BUG repair part

  1. Fix the problem of abnormal query conditions for exporting all contents of data table
  2. Fix invalid $max parameter setting of table progressBar #182
  3. Fix the problem that the creation permission cannot display the routing options when the routing prefix is set to null #194
  4. Fix the problem that model watchers cannot get model data when deleting data
  5. Fix the Grid::fetching event that may trigger repeatedly
  6. Fix column search chart display exception when table displays scroll bar #192
  7. Fix the problem that the hasMany form cannot use the dateRange form #199
  8. Fix the problem that the action request returns the unauthorized information
  9. Fix editable style exception
  10. Repair table one to the first mock exam field language package translation exception

Topics: PHP Laravel github Attribute