Back to Daisyui

Install daisyUI for Laravel

packages/docs/src/routes/(routes)/docs/install/laravel/+page.md

5.5.19963 B
Original Source
<script> import Translate from "$components/Translate.svelte" </script>

1. Create a new Laravel project

Install PHP, Composer and Laravel Installer according to the official Laravel documentation

Create a new Laravel project

sh:Terminal
laravel new my-app
cd my-app

2. Install daisyUI

sh:Terminal
npm i -D daisyui@latest

Put Tailwind CSS and daisyUI in your CSS file (and remove old styles)

css:resources/css/app.css
@import "tailwindcss";

@source "../**/*.blade.php";
@source "../**/*.js";
@source "../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php";
@source "../../storage/framework/views/*.php";

@plugin "daisyui";

3. Run your project

Run your Laravel project

sh:Terminal
php artisan serve

And on another terminal tab, run Vite

sh:Terminal
npm run dev

Now you can use daisyUI class names!