Skip to content

Commit

Permalink
update config/views/assets for backpack 6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-kamil committed Feb 7, 2024
1 parent ef47b4a commit d563536
Show file tree
Hide file tree
Showing 20 changed files with 254 additions and 217 deletions.
184 changes: 1 addition & 183 deletions config/backpack/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,165 +2,6 @@

return [

/*
|--------------------------------------------------------------------------
| Look & feel customizations
|--------------------------------------------------------------------------
|
| Make it yours.
|
*/

// Date & Datetime Format Syntax: https://carbon.nesbot.com/docs/#api-localization
'default_date_format' => 'D MMM YYYY',
'default_datetime_format' => 'D MMM YYYY, HH:mm',

// Direction, according to language
// (left-to-right vs right-to-left)
'html_direction' => 'ltr',

// ----
// HEAD
// ----

// Project name. Shown in the window title.
'project_name' => 'Backpack Admin Panel',

// When clicking on the admin panel's top-left logo/name,
// where should the user be redirected?
// The string below will be passed through the url() helper.
// - default: '' (project root)
// - alternative: 'admin' (the admin's dashboard)
'home_link' => '',

// Content of the HTML meta robots tag to prevent indexing and link following
'meta_robots_content' => 'noindex, nofollow',

// ---------
// DASHBOARD
// ---------

// Show "Getting Started with Backpack" info block?
'show_getting_started' => env('APP_ENV') == 'local',

// ------
// STYLES
// ------

// CSS files that are loaded in all pages, using Laravel's asset() helper
'styles' => [
'packages/backpack/base/css/bundle.css', // has primary color electric purple (backpack default)
// 'packages/backpack/base/css/blue-bundle.css', // has primary color blue

// Here's what's inside the bundle:
// 'packages/@digitallyhappy/backstrap/css/style.min.css',
// 'packages/animate.css/animate.min.css',
// 'packages/noty/noty.css',

// Load the fonts separately (so that you can replace them at will):
'packages/source-sans-pro/source-sans-pro.css',
'packages/line-awesome/css/line-awesome.min.css',

// Example (the fonts above, loaded from CDN instead)
// 'https://maxcdn.icons8.com/fonts/line-awesome/1.1/css/line-awesome-font-awesome.min.css',
// 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic',

// Example (load font-awesome instead of line-awesome):
// 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css',
],

// CSS files that are loaded in all pages, using Laravel's mix() helper
'mix_styles' => [ // file_path => manifest_directory_path
// 'css/app.css' => '',
],

// CSS files that are loaded in all pages, using Laravel's @vite() helper
// Please note that support for Vite was added in Laravel 9.19. Earlier versions are not able to use this feature.
'vite_styles' => [ // resource file_path
// 'resources/css/app.css',
],

// ------
// HEADER
// ------

// Menu logo. You can replace this with an <img> tag if you have a logo.
'project_logo' => '<b>Back</b>pack',

// Show / hide breadcrumbs on admin panel pages.
'breadcrumbs' => true,

// Horizontal navbar classes. Helps make the admin panel look similar to your project's design.
'header_class' => 'app-header bg-light border-0 navbar',
// For background colors use: bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan, bg-white
// For links to be visible on different background colors use: "navbar-dark", "navbar-light", "navbar-color"

// ----
// BODY
// ----

// Body element classes.
'body_class' => 'app aside-menu-fixed sidebar-lg-show',
// Try sidebar-hidden, sidebar-fixed, sidebar-compact, sidebar-lg-show

// Sidebar element classes.
'sidebar_class' => 'sidebar sidebar-pills bg-light',
// Remove "sidebar-transparent" for standard sidebar look
// Try "sidebar-light" or "sidebar-dark" for dark/light links
// You can also add a background class like bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan

// ------
// FOOTER
// ------

// Footer element classes.
'footer_class' => 'app-footer d-print-none',
// hide it with d-none
// change background color with bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan, bg-white

// Developer or company name. Shown in footer.
'developer_name' => 'Cristian Tabacitu',

// Developer website. Link in footer. Type false if you want to hide it.
'developer_link' => 'http://tabacitu.ro',

// Show powered by Laravel Backpack in the footer? true/false
'show_powered_by' => true,

// -------
// SCRIPTS
// -------

// JS files that are loaded in all pages, using Laravel's asset() helper
'scripts' => [
// Backstrap includes jQuery, Bootstrap, CoreUI, PNotify, Popper
'packages/backpack/base/js/bundle.js',

// examples (everything inside the bundle, loaded from CDN)
// 'https://code.jquery.com/jquery-3.4.1.min.js',
// 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js',
// 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js',
// 'https://unpkg.com/@coreui/coreui@2.1.16/dist/js/coreui.min.js',
// 'https://cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js',
// 'https://unpkg.com/sweetalert/dist/sweetalert.min.js',
// 'https://cdnjs.cloudflare.com/ajax/libs/noty/3.1.4/noty.min.js'

// examples (VueJS or React)
// 'https://unpkg.com/vue@2.4.4/dist/vue.min.js',
// 'https://unpkg.com/react@16/umd/react.production.min.js',
// 'https://unpkg.com/react-dom@16/umd/react-dom.production.min.js',
],

// JS files that are loaded in all pages, using Laravel's mix() helper
'mix_scripts' => [ // file_path => manifest_directory_path
// 'js/app.js' => '',
],

// JS files that are loaded in all pages, using Laravel's @vite() helper
'vite_scripts' => [ // resource file_path
// 'resources/js/app.js',
],

/*
|--------------------------------------------------------------------------
| Registration Open
Expand Down Expand Up @@ -268,7 +109,7 @@
// Username column for authentication
// The Backpack default is the same as the Laravel default (email)
// If you need to switch to username, you also need to create that column in your db
'authentication_column' => 'email',
'authentication_column' => 'email',
'authentication_column_name' => 'Email',

// Backpack assumes that your "database email column" for operations like Login and Register is called "email".
Expand All @@ -294,29 +135,6 @@
// 'blank' will keep the generic image with the user first letter
'gravatar_fallback' => 'blank',

/*
|--------------------------------------------------------------------------
| Theme (User Interface)
|--------------------------------------------------------------------------
*/
// Change the view namespace in order to load a different theme than the one Backpack provides.
// You can create child themes yourself, by creating a view folder anywhere in your resources/views
// and choosing that view_namespace instead of the default one. Backpack will load a file from there
// if it exists, otherwise it will load it from the default namespace ("backpack::").

'view_namespace' => 'backpack::',

// EXAMPLE: if you create a new folder in resources/views/vendor/myname/mypackage,
// your namespace would be the one below. IMPORTANT: in this case the namespace ends with a dot.
// 'view_namespace' => 'vendor.myname.mypackage.',

// Tell Backpack to look in more places for component views (like widgets)
'component_view_namespaces' => [
'widgets' => [
'backpack::widgets', // falls back to 'resources/views/vendor/backpack/base/widgets'
],
],

/*
|--------------------------------------------------------------------------
| File System
Expand Down
39 changes: 39 additions & 0 deletions config/backpack/operations/form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/**
* Default configurations for custom form operations.
*/

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-12 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?
'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' => false, //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 - use Backpack's default (ONLY save inputs that have fields)
// - invokable class - custom stripping (the return should be an array with input names)
// 'strippedRequest' => App\Http\Requests\StripBackpackRequest::class,
];
46 changes: 46 additions & 0 deletions config/backpack/theme-coreuiv2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Theme Configuration Values
|--------------------------------------------------------------------------
|
| The file provides extra configs on top of config/backpack/ui.php
|
| Any value set here will override the ones defined in
| config/backpack/ui.php when this theme is in use.
|
*/

// the layout used for authenticated users in the application
// this layout is used to display errors to logged users
'layout' => 'top_left',

// -------
// CLASSES
// -------

// These can help make the admin panel look similar to your project's design.
'classes' => [

'header' => 'app-header bg-light border-0 navbar',
// For background colors use: bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan, bg-white
// For links to be visible on different background colors use: "navbar-dark", "navbar-light", "navbar-color"

'body' => 'app aside-menu-fixed sidebar-lg-show',
// Try sidebar-hidden, sidebar-fixed, sidebar-compact, sidebar-lg-show

'sidebar' => 'sidebar sidebar-pills bg-light',
// Remove "sidebar-transparent" for standard sidebar look
// Try "sidebar-light" or "sidebar-dark" for dark/light links
// You can also add a background class like bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan

'footer' => 'app-footer d-print-none',
// hide it with d-none
// change background color with bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan, bg-white

]

];
Loading

0 comments on commit d563536

Please sign in to comment.