Listing – A Weblog of Priyank Maniar https://priyank.rocks Articles on web development & mobile app development Sat, 25 Dec 2021 02:04:31 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 [Resolved] Scroll issue with the export columns visibility | BackpackForLaravel https://priyank.rocks/resolved-scroll-issue-with-the-export-columns-visibility-backpackforlaravel/ Wed, 22 Dec 2021 10:18:28 +0000 https://priyank.rocks/?p=8711 This solution was tested on BackpackForLaravel Version 4.1.

1
2
3
4
5
6
7
8
9
10
/* File: list.css */

/*------------------------------------------------
    Custom Added
--------------------------------------------------*/


.dt-button-collection {
    overflow-y: scroll;
    max-height: 200px;
}
]]>
How to add conditions to the query/listing module in BackpackForLaravel https://priyank.rocks/how-to-add-conditions-to-the-query-listing-module-in-backpackforlaravel/ Sat, 21 Nov 2020 12:31:07 +0000 https://priyank.rocks/?p=7319 How to query for a specific role in the admin panel using BackpackForLaravel
1
$this->crud->addClause('role', 'Admin');

How to remove ellipsis on a column for BackpackForLaravel?

One might have any type of column such as relationship, but when the column text is long, it gets truncated. This is not done via CSS, so we need a different kind of solution for this.

I encountered this issue for a Relationship field and the easiest fix was to convert the column to a Closure and then the output is not going to be truncated.

Converting a Relationship to a Closure is easy as it can get.

1
2
3
4
5
6
7
8
9
10
11
$this->crud->addColumn(
    [
        'type'     => "closure",
        'name'     => 'relationship_function',  
        'label'    => 'Label',
        'function' => function($entry) {

            return $entry->relationship_function->column;
        },
    ]
);

How to apply a scope?

1
$this->crud->addClause('active'); // apply a local scope
]]>