Skip to content

Commit

Permalink
chore: #547 publish new backpack configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
m-triassi committed Jul 12, 2022
1 parent 040ab62 commit c2bf4d9
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 0 deletions.
49 changes: 49 additions & 0 deletions config/backpack/operations/create.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

/**
* Configurations for Backpack's CreateOperation.
*
* @see https://backpackforlaravel.com/docs/crud-operation-create
*/

return [
// Define the size/looks of the content div for all CRUDs
// To override per view use $this->crud->setCreateContentClass('class-string')
'contentClass' => 'col-md-8 bold-labels',

// When using tabbed forms (create & update), what kind of tabs would you like?
'tabsType' => 'horizontal', //options: horizontal, vertical

// How would you like the validation errors to be shown?
'groupedErrors' => true,
'inlineErrors' => true,

// when the page loads, put the cursor on the first input?
'autoFocusOnFirstField' => true,

// Where do you want to redirect the user by default, save?
// options: save_and_back, save_and_edit, save_and_new
'defaultSaveAction' => 'save_and_back',

// When the user chooses "save and back" or "save and new", show a bubble
// for the fact that the default save action has been changed?
'showSaveActionChange' => true, //options: true, false

// Should we show a cancel button to the user?
'showCancelButton' => true,

// Should we warn a user before leaving the page with unsaved changes?
'warnBeforeLeaving' => false,

/**
* Before saving the entry, how would you like the request to be stripped?
* - false - fall back to Backpack's default (ONLY save inputs that have fields)
* - closure - process your own request (example removes all inputs that begin with underscode).
*
* @param \Illuminate\Http\Request $request
* @return array
*/
// 'strippedRequest' => (function ($request) {
// return $request->except('_token', '_method', '_http_referrer', '_current_tab', '_save_action');
// }),
];
60 changes: 60 additions & 0 deletions config/backpack/operations/list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

/**
* Configurations for Backpack's ListOperation.
*
* @see https://backpackforlaravel.com/docs/crud-operation-list
*/

return [
// Define the size/looks of the content div for all CRUDs
// To override per view use $this->crud->setListContentClass('class-string')
'contentClass' => 'col-md-12',

// enable the datatables-responsive plugin, which hides columns if they don't fit?
// if not, a horizontal scrollbar will be shown instead
'responsiveTable' => true,

// stores pagination and filters in localStorage for two hours
// whenever the user tries to see that page, backpack loads the previous pagination and filtration
'persistentTable' => true,

// show search bar in the top-right corner?
'searchableTable' => true,

// the time the table will be persisted in minutes
// after this the table info is cleared from localStorage.
// use false to never force localStorage clear. (default)
// keep in mind: User can clear their localStorage whenever they want.

'persistentTableDuration' => false,

// How many items should be shown by default by the Datatable?
// This value can be overwritten on a specific CRUD by calling
// $this->crud->setDefaultPageLength(50);
'defaultPageLength' => 10,

// A 1D array of options which will be used for both the displayed option and the value, or
// A 2D array in which the first array is used to define the value options and the second array the displayed options
// If a 2D array is used, strings in the right hand array will be automatically run through trans()
'pageLengthMenu' => [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']],

// How important is it for the action buttons to be visible?
// - 0 - most important
// - 1 - as important as bulk buttons
// - 2-3 - more important than the rest of the columns
// - 4 - less important than most columns
'actionsColumnPriority' => 1,

// Show a "Reset" button next to the List operation subheading
// (Showing 1 to 25 of 9999 entries. Reset)
// that allows the user to erase local storage for that datatable,
// thus clearing any searching, filtering or pagination that has been
// remembered and persisted using persistentTable
'resetButton' => true,

// The query operator that is used to search on the table.
// If you are using PostgreSQL you might want to change
// to `ilike` for case-insensitive search
'searchOperator' => 'like',
];
13 changes: 13 additions & 0 deletions config/backpack/operations/reorder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* Configurations for Backpack's ReorderOperation.
*
* @see https://backpackforlaravel.com/docs/crud-operation-reorder
*/

return [
// Define the size/looks of the content div for all CRUDs
// To override per Controller use $this->crud->setReorderContentClass('class-string')
'contentClass' => 'col-md-8 col-md-offset-2',
];
24 changes: 24 additions & 0 deletions config/backpack/operations/show.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* Configurations for Backpack's ShowOperation.
*
* @see https://backpackforlaravel.com/docs/crud-operation-show
*/

return [
// Define the size/looks of the content div for all CRUDs
// To override per Controller use $this->crud->setShowContentClass('class-string')
'contentClass' => 'col-md-8',

// Automatically add all columns from the db table?
'setFromDb' => true,

// Automatically add created_at and updated_at columns, if model has timestamps?
'timestamps' => true,

// If model has SoftDeletes, allow the admin to access the Show page for
// soft deleted items & add a deleted_at column to ShowOperation?
'softDeletes' => false,

];
49 changes: 49 additions & 0 deletions config/backpack/operations/update.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

/**
* Configurations for Backpack's UpdateOperation.
*
* @see https://backpackforlaravel.com/docs/crud-operation-update
*/

return [
// Define the size/looks of the content div for all CRUDs
// To override per view use $this->crud->setEditContentClass('class-string')
'contentClass' => 'col-md-8 bold-labels',

// When using tabbed forms (create & update), what kind of tabs would you like?
'tabsType' => 'horizontal', //options: horizontal, vertical

// How would you like the validation errors to be shown?
'groupedErrors' => true,
'inlineErrors' => true,

// when the page loads, put the cursor on the first input?
'autoFocusOnFirstField' => true,

// Where do you want to redirect the user by default, save?
// options: save_and_back, save_and_edit, save_and_new
'defaultSaveAction' => 'save_and_back',

// When the user chooses "save and back" or "save and new", show a bubble
// for the fact that the default save action has been changed?
'showSaveActionChange' => true, //options: true, false

// Should we show a cancel button to the user?
'showCancelButton' => true,

// Should we warn a user before leaving the page with unsaved changes?
'warnBeforeLeaving' => false,

/**
* Before saving the entry, how would you like the request to be stripped?
* - false - fall back to Backpack's default (ONLY save inputs that have fields)
* - closure - process your own request (example removes all inputs that begin with underscode).
*
* @param \Illuminate\Http\Request $request
* @return array
*/
// 'strippedRequest' => (function ($request) {
// return $request->except('_token', '_method', '_http_referrer', '_current_tab', '_save_action');
// }),
];

0 comments on commit c2bf4d9

Please sign in to comment.