CoderFunda
  • Home
  • About us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • About us
  • Home
  • Php
  • HTML
  • CSS
  • JavaScript
    • JavaScript
    • Jquery
    • JqueryUI
    • Stock
  • SQL
  • Vue.Js
  • Python
  • Wordpress
  • C++
    • C++
    • C
  • Laravel
    • Laravel
      • Overview
      • Namespaces
      • Middleware
      • Routing
      • Configuration
      • Application Structure
      • Installation
    • Overview
  • DBMS
    • DBMS
      • PL/SQL
      • SQLite
      • MongoDB
      • Cassandra
      • MySQL
      • Oracle
      • CouchDB
      • Neo4j
      • DB2
      • Quiz
    • Overview
  • Entertainment
    • TV Series Update
    • Movie Review
    • Movie Review
  • More
    • Vue. Js
    • Php Question
    • Php Interview Question
    • Laravel Interview Question
    • SQL Interview Question
    • IAS Interview Question
    • PCS Interview Question
    • Technology
    • Other

24 April, 2021

Build Custom Admin Panels With Backpack for Laravel

 Programing Coderfunda     April 24, 2021     Packages, php     No comments   

 

Build Custom Admin Panels With Backpack for Laravel

Backpack for Laravel is a collection of packages which allows you to create admin panels for any web app quickly. It provides a set of useful packages divided into three categories that will make the process of creating a highly customizable admin panel easier.

Installation

The fastest way to take a look at Backpack is by using the ready-made demo app which comes with all the packages preinstalled. If you want to use it in a real app, read the manual installation documentation which will be more suitable; you will only choose the packages you need.

To use the demo app, clone the demo repo by running the following command:

git clone https://github.com/Laravel-Backpack/demo.git backpack-demo

Then, customize your database information in the .env file.

Next, install the package through Composer by running:

composer install

Now, migrate the database by running the following command:

php artisan migrate

If you are using Valet, you can access the demo admin panel by visiting http://backpack-demo.dev/admin in your browser.

Create a new user by clicking the register button on the top nav and filling in the form with your credentials. After you’ve logged in, you will see the Dashboard page:

Build Custom Admin Panels With Backpack for Laravel

Overview

Backpack comes with three different types of packages: core packages, ready-made CRUDs, and extensions.

Core Packages

There are two core packages. The first is Backpack\Base which consists of the AdminLTE theme integrated with an alert component and some views for login, register, forgotten passwords, and errors pages.

The second package is Backpack\CRUD which is accelerating the process of building CRUDs for admin panels. It provides more than 44 field types, DataTables integration, file browsing, and creating form requests for backend validation.

You can use Backpack\CRUD for building CRUDs manually like in this example in the docs, but we will take a look at a faster way for automatic CRUDs generation using Backpack\Generators later in this article.

Ready-Made CRUDs

Backpack provides five already built CRUDs which target the most commonly used CRUDs in web apps. Let’s take a look:

Backpack PermissionManager:

A CRUD for managing users, roles, and permissions so you can assign a user multiple roles and permissions.

Build Custom Admin Panels With Backpack for Laravel

Backpack Settings

An interface for easily changing the application settings, it provides different types of settings such as email, check boxes, text, numbers, etc. Be aware it does not include an interface for adding new settings, so you should add them directly to the database. If you want to retrieve any a setting’s value you can use Config::get('settings.admin_name').

Build Custom Admin Panels With Backpack for Laravel

Backpack PageManager

It’s a CRUD for creating pages for your website using predefined templates with any fields you want and ability to use various fields types. To define your templates, open app/PageTemplates.php file and add your template like this:

Now, you can create a new page using our new template like this:

Build Custom Admin Panels With Backpack for Laravel

Backpack NewsCRUD

It’s a CRUD for quickly creating anything related to news; you create articles, tags, categories with support for nesting categories and reordering them.

Add article interface:

Build Custom Admin Panels With Backpack for Laravel

Categories management page:

Build Custom Admin Panels With Backpack for Laravel

Backpack MenuCRUD

A CRUD for adding, editing, deleting, reordering, and nesting menu items. It provides the ability to use internal or external links, and you can link to a page from Backpack\PageManager.

Build Custom Admin Panels With Backpack for Laravel

Extensions Packages

Currently, there are three extension packages for Backpack; let’s take a look at each of them:

Backpack BackupManager:

An interface for creating and managing backups for files and database, it provides support for various drivers like S3, Dropbox, Google Drive, Box, etc. For more details, check out the package readme at github.

Build Custom Admin Panels With Backpack for Laravel

Backpack LogManager

An interface for dealing with Laravel log files. You can download, preview, or delete without accessing your server through SSH.

Build Custom Admin Panels With Backpack for Laravel

Backpack Generators

The generator is an essential package as it will accelerate the process of creating CRUDs and make it as simple as running a single command!

Let’s assume that we want to create a CRUD for products, so we want the following:

  • A database table called products.
  • A model app/Models/Product.php
  • A controller app/Http/Controllers/Admin/ProductCrudController.php
  • A request app/Http/Requests/ProductCrudRequest.php
  • A new route

To make that with Backpack\Generators:

  • First, make the migration file:
php artisan make:migration:schema create_products_table --schema="name:string:unique" --model=0

  • Then, migrate to the database:
php artisan migrate

  • After that, use Backpack\Generators to create the CRUD:
php artisan backpack:crud product

  • Last, open your routes/web.php to add the following route:
Route::group(['prefix' => config('backpack.base.route_prefix', 'admin'), 'middleware' => ['web', 'auth']], function () {
CRUD::resource('product', 'Admin\ProductCrudController');
});

Now, if you use Valet, open http://backpack-demo.dev/admin/product in your browser and access the Products CRUD page so you can add and manage products easily:

Build Custom Admin Panels With Backpack for Laravel

Backpack Pricing

Backpack has two tiers of pricing. A free non-commercial license which includes personal use, non-profits, testing, and students. There is a commercial license priced at $19 if you are going to use it to generate income, such as being used by freelancers, employees, or companies.


  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook

Related Posts:

  • PHPUnit SpeedTrapPHPUnit Speedtrap is a package by John Kary that reports on slow-running tests in your PHPUnit test suite. This package is inspired by Ruby RSpec’s&nb… Read More
  • Snipe Migrations Laravel Package Snipe Migrations is a Laravel package by Dustin Fraker for “blazing fast” database migrations for tests:The package takes a snapshot of your mys… Read More
  • Customizing Stubs in Laravel This post will show you how to customize stubs used to generate various classes in your application. While a minor inconvenience, manually adjus… Read More
  • Laravel Favicon PackageLaravel Favicon is a package by Marcel Pociot that enables you to create dynamic favicons based on your environment settings: The package works by u… Read More
  • Laravel Tinker Server PackageLaravel Tinker Server is a package by Marcel Pociot that enables you to tinker with your variables in real-time while working on your Laravel app. Thi… Read More
Newer Post Older Post Home

0 comments:

Post a Comment

Thanks

Meta

Popular Posts

  • Spring boot app (error: method getFirst()) failed to run at local machine, but can run on server
    The Spring boot app can run on the online server. Now, we want to replicate the same app at the local machine but the Spring boot jar file f...
  • Log activity in a Laravel app with Spatie/Laravel-Activitylog
      Requirements This package needs PHP 8.1+ and Laravel 9.0 or higher. The latest version of this package needs PHP 8.2+ and Laravel 8 or hig...
  • Laravel auth login with phone or email
          <?php     Laravel auth login with phone or email     <? php     namespace App \ Http \ Controllers \ Auth ;         use ...
  • Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh
    I had follow these steps to install an configure firebase to my cordova project for cloud messaging. https://medium.com/@felipepucinelli/how...
  • Cashier package and Blade files
    I'm a little confused about this Cashier package. I installed it using the Laravel website (with composer), but noticed there's no...

Categories

  • Ajax (26)
  • Bootstrap (30)
  • DBMS (42)
  • HTML (12)
  • HTML5 (45)
  • JavaScript (10)
  • Jquery (34)
  • Jquery UI (2)
  • JqueryUI (32)
  • Laravel (1017)
  • Laravel Tutorials (23)
  • Laravel-Question (6)
  • Magento (9)
  • Magento 2 (95)
  • MariaDB (1)
  • MySql Tutorial (2)
  • PHP-Interview-Questions (3)
  • Php Question (13)
  • Python (36)
  • RDBMS (13)
  • SQL Tutorial (79)
  • Vue.js Tutorial (68)
  • Wordpress (150)
  • Wordpress Theme (3)
  • codeigniter (108)
  • oops (4)
  • php (853)

Social Media Links

  • Follow on Twitter
  • Like on Facebook
  • Subscribe on Youtube
  • Follow on Instagram

Pages

  • Home
  • Contact Us
  • Privacy Policy
  • About us

Blog Archive

  • September (100)
  • August (50)
  • July (56)
  • June (46)
  • May (59)
  • April (50)
  • March (60)
  • February (42)
  • January (53)
  • December (58)
  • November (61)
  • October (39)
  • September (36)
  • August (36)
  • July (34)
  • June (34)
  • May (36)
  • April (29)
  • March (82)
  • February (1)
  • January (8)
  • December (14)
  • November (41)
  • October (13)
  • September (5)
  • August (48)
  • July (9)
  • June (6)
  • May (119)
  • April (259)
  • March (122)
  • February (368)
  • January (33)
  • October (2)
  • July (11)
  • June (29)
  • May (25)
  • April (168)
  • March (93)
  • February (60)
  • January (28)
  • December (195)
  • November (24)
  • October (40)
  • September (55)
  • August (6)
  • July (48)
  • May (2)
  • January (2)
  • July (6)
  • June (6)
  • February (17)
  • January (69)
  • December (122)
  • November (56)
  • October (92)
  • September (76)
  • August (6)

  • Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh - 9/21/2024
  • pyspark XPath Query Returns Lists Omitting Missing Values Instead of Including None - 9/20/2024
  • SQL REPL from within Python/Sqlalchemy/Psychopg2 - 9/20/2024
  • MySql Explain with Tobias Petry - 9/20/2024
  • How to combine information from different devices into one common abstract virtual disk? [closed] - 9/20/2024

Laravel News

  • Auto-translate Application Strings with Laratext - 5/16/2025
  • Simplify Factory Associations with Laravel's UseFactory Attribute - 5/13/2025
  • Improved Installation and Frontend Hooks in Laravel Echo 2.1 - 5/15/2025
  • Filter Model Attributes with Laravel's New except() Method - 5/13/2025
  • Arr::from() Method in Laravel 12.14 - 5/14/2025

Copyright © 2025 CoderFunda | Powered by Blogger
Design by Coderfunda | Blogger Theme by Coderfunda | Distributed By Coderfunda