Install via Composer
composer require better-futures-studio/dall
Run the preset installer:
php artisan dall:install
This publishes assets, config, and sets up Vite for Alpine.js/daisyUI.
First Use Case: Scaffold a New View
Create a new Blade view (e.g., resources/views/layouts/app.blade.php):
<x-app-layout>
@yield('content')
</x-app-layout>
Extend it in child views:
@extends('layouts.app')
@section('content') ... @endsection
Quick Theme Switcher Add the theme switcher component to your layout:
<x-theme-switcher />
Users can toggle themes (e.g., light, dark, cupcake) dynamically.
Asset Management
vite.config.js to add custom assets:
export default defineConfig({
plugins: [
laravel({
input: ['resources/js/app.js', 'resources/css/app.css'],
refresh: true,
}),
],
});
npm run dev
Livewire Integration Use Livewire for reactive components. Example:
// app/Http/Livewire/ExampleComponent.php
public function render() {
return view('livewire.example-component');
}
<!-- resources/views/livewire/example-component.blade.php -->
<div x-data="{ open: false }">
<button @click="open = !open">Toggle</button>
<!-- Livewire content -->
</div>
Pagination Views Replace default pagination with daisyUI’s:
{{ $posts->links('vendor.pagination.daisyui') }}
Customize in resources/views/vendor/pagination/daisyui.blade.php.
Theme Customization
tailwind.config.js:
daisyui: {
themes: ['light', 'dark'], // Only enable these
}
@component directives for reusable UI (e.g., <x-card />).dark class. Toggle via:
// Alpine.js
document.documentElement.classList.toggle('dark');
Vite Build Failures
@tailwindcss/typography).npm install @tailwindcss/typography daisyui
npm run dev output for errors.Theme Switcher Not Persisting
theme-switcher component uses Alpine.js to sync with localStorage:
<x-theme-switcher :themes="['light', 'dark']" />
Default themes are pre-configured; extend via props.Livewire + Alpine Conflicts
wire:ignore on Alpine-managed elements:
<div wire:ignore x-data="{ ... }">
<!-- Alpine logic -->
</div>
Tailwind/DaisyUI Version Mismatches
package.json:
"daisyui": "^x.y.z",
"tailwindcss": "^3.0.0"
npx tailwindcss -i input.css -o output.css --watch to debug.btn-primary are applied.npm run build
tailwind.config.js: Ensure plugins include DaisyUI:
plugins: [require('daisyui')],
Custom DaisyUI Themes
Extend themes in tailwind.config.js:
daisyui: {
themes: [
{
mytheme: {
'primary': '#3b82f6',
'secondary': '#10b981',
},
},
],
}
Livewire Component Styling Scope DaisyUI classes to Livewire components:
<div x-data x-init="$wire.init()">
<button class="btn btn-primary">Action</button>
</div>
Alpine.js Event Listeners Listen for theme changes globally:
// resources/js/app.js
document.addEventListener('theme-changed', (e) => {
console.log('Theme updated to:', e.detail);
});
How can I help you explore Laravel packages today?