Table of Contents
1. LARAVEL 11 - Bootstrap 5 - DataTables - Introduction
Let me introduce a demo LARAVEL 11 – BOOTSTRAP 5 project featuring DATATABLES.
You can quickly adapt this project to your own needs.
Tip :
If you’re looking for an excellent Local Web Development Server to develop your PHP based applications in a Microsoft Windows environment, please read my posts regarding Laragon.
2. LARAVEL 11 - Bootstrap 5 - DataTables - Description
This application requires at least PHP 8.2 and build using :
- Laravel 11 featuring Vite
- Bootstrap 5
- DataTables
- Top button bar to quickly navigate to the main parts of your application
- Offcanvas menu to access less frequently used parts
- Datatables, fully integrated with build in :
- Create – Show – Update – Delete (CRUD) with Bootbox.js dialogs and Toastr notifications
- Copy to clipboard
- Export to PDF and Excel
- Print function
- Items per page selector
- Column visibility selector
- Search with result highlighting
- Server-side pagination and filtering
- Multiple row selection (for mass deletes)
- Inline boolean field toggable
- Help
Tip:
This demo Laravel 11 – Bootstrap 5 project using Datatables is available on GitHub.
Open source under MIT License.
3. LARAVEL 11 - Bootstrap 5 - DataTables - Demo
You can visit the live demo at https://www.demo.kreaweb.be.
Klick the login button in the top navigation bar.
- Username : admin@admin.com
- Password : password
Then visit the Customers page.
3. LARAVEL 11 - Bootstrap 5 - DataTables - Build
a. Clone the GitHub repository
Inside the root folder of your local web development environment, open a new terminal window.
Enter the command :
git clone https://github.com/MGeurts/laravel-11-bootstrap-5-datatables.git .
Change directory into the newly created project folder. b. Install Composer Dependencies
Enter the command :
composer install
c. Install NPM Dependencies
Enter the commands :
npm install
npm run dev or npm run build
d. Create your copy of the .env file
Enter the command :
cp .env.example .env
e. Generate an App Encryption Key
Enter the command :
php artisan key:generate
f. Create an empty database for our application
Use your favorite database management tool to create an empty database.
Configure a username and password.
g. Configure the .env file
Open the .env file for editing :
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=********
Adjust the DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD options to match your situation.
Also adjust the mail settings:
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
Adjust the MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_ENCRYPTION and MAIL_FROM_ADDRESS options to match your situation. h. Migrate the database
Enter the command : :
php artisan migrate:fresh --seed