isanjayjoshi's avatar

Building Bootstrap Admin Panels with Laravel is it possible ?

I'm exploring the best practices for integrating Bootstrap Templates into Laravel for creating web app.

What are the common challenges encountered during this process, and what are the recommended solutions?

Are there any specific Bootstrap templates that you find particularly well-suited for Laravel ?

0 likes
7 replies
martinbean's avatar
Level 80

@isanjayjoshi Yes, it’s possible. I’m not sure why you don’t think it would be? Bootstrap is just a CSS and JavaScript library. I’ve made many admin panels (and websites and web applications) using Bootstrap.

  1. Install Bootstrap via npm: npm install bootstrap --save-dev

  2. Create a SCSS file, and import the “main” Bootstrap stylesheet in a resources/sass/app.scss file:

@import "bootstrap/scss/bootstrap";
  1. Update your vite.config.js file to reference this SCSS file:
  input: [
-     'resources/css/app.css',
+     'resources/sass/app.scss',
      'resources/js/app.js',
  ]
  1. Then include that file in the @vite directive in your layout template:
@vite(['resources/sass/app.scss'])

You should then have a web page with Bootstrap styling.

This isn’t Bootstrap-specific advice, but when working with libraries such as Bootstrap, as I’m creating templates, I’ll extract common patterns (such as buttons, cards, etc) to Blade components:

<x-card>
    <x-slot:header>Card header</x-slot:header>
    <x-slot:body>
        <p class="card-text">Card body.</p>
    </x-slot:body>
    <x-slot:footer>Card footer</x-slot:footer>
</x-card>

That way, mark-up for components are isolated to one file (the component itself) so that if say, a new version of Bootstrap was released and changed the names of classes, I’d only have to change the class names in the one component view, rather than everywhere in my application where I had copy-and-pasted mark-up for a card.

1 like
isanjayjoshi's avatar

Thanks @martinbean for your ans this will help me for implenting my admin panels.

I'm new to Dashboard development and exploring Bootstrap templatesfor front-end work alongside Laravel. I'm curious to hear laracasts people experiences and opinions on using Bootstrap admin templates with Laravel projects.

gfucci's avatar

@isanjayjoshi I always use bootstrap because I have a lot of familiarity, but nowadays people prefer tailwind or vue templates for inertia stack or TALL.

some cool templates are CoreUI, plainadmin, adminkit bootstrap5, adminLTE....

martinbean's avatar

@isanjayjoshi Just a little bit disingenuous to ask about Bootstrap-based admin panels, only to reply with a link to your own site with an affiliate tag…

@jeffreyway Think this should be treated as spam.

Snapey's avatar

stop spamming the site to promote your templates trash!

1 like
isanjayjoshi's avatar

Snapey, Yes I understand after your msg i stopped any link on laracasts.

martinbean's avatar

@isanjayjoshi It really took you six months to reply with that…? More like you’re just bumping the thread to bring your spam link back to the front page.

Please or to participate in this conversation.