Integrate SB Admin 2 in Laravel
Source: Dev.to
Laravel 11 Requirements
php -v # >= 8.2
composer -v
node -v # >= v14.16
npm -v
Start Apache & MySQL on your web server.
Install Laravel 11
composer create-project "laravel/laravel:^11.0" example-app
or using the Laravel installer:
composer global require laravel/installer
laravel new example-app
.env configuration
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_db
DB_USERNAME=root
DB_PASSWORD=your_password
Migrate & serve
php artisan migrate
php artisan serve
Download SB Admin 2
- Clone or download the repository
raflizocky/laravel11-sbadmin2. - Extract and rename the folder to
sbadmin2(or any name you prefer). - Move the folder into Laravel’s
publicdirectory.
Base Layout
Create a Blade component for the layout:
resources/views/components/layout.blade.php
Copy the content of index.html from SB Admin 2 into this file and update all asset paths, e.g.:
Components
Header (resources/views/components/header.blade.php)
...
Footer (resources/views/components/footer.blade.php)
Copyright © Your Website 2021
Sidebar (resources/views/components/sidebar.blade.php)
(Add your sidebar markup here, following the SB Admin 2 template.)
Topbar (resources/views/components/topbar.blade.php)
(Add your topbar markup here, following the SB Admin 2 template.)
Layout Blade (resources/views/layout.blade.php)
{{ $slot }}
Dashboard
Controller (app/Http/Controllers/DashboardController.php)
## Dashboard
Need help building your app?
raflizocky.netlify.app
Support the author:
- PayPal:
- Saweria: