-
Notifications
You must be signed in to change notification settings - Fork 0
installation
This guide will walk you through the process of installing and configuring ArtisanPack UI Livewire Components in your Laravel application.
Before installing ArtisanPack UI Livewire Components, ensure your environment meets the following requirements:
- Laravel 12+: The package is designed for Laravel 12 or newer
- PHP 8.1+: PHP 8.1 or newer is required
- Node.js and NPM/Yarn/Bun/PNPM: Required for compiling assets
- Composer: Required for installing the package
Begin by installing the package through Composer:
composer require artisanpack-ui/livewire-ui-componentsAfter installing the package, run the installation command:
php artisan livewire-ui-components:installThis interactive installer will:
- Check your Laravel version
- Ask if you want to install Livewire/Volt
- Detect and use your preferred package manager (npm, yarn, bun, or pnpm)
- Install Livewire and optionally Volt
- Set up Tailwind CSS and DaisyUI
- Copy example components if you're starting a new project
- Configure component prefixing if needed
During installation, you'll be prompted with several options:
Also install `livewire/volt` ?
> Yes
No
Choose whether to install Livewire/Volt alongside Livewire. Volt provides a simplified syntax for creating Livewire components.
Install with ...
> npm install --save-dev
yarn add -D
bun i -D
pnpm i -D
Select your preferred package manager for installing JavaScript dependencies.
After installation:
-
Compile your assets:
npm run dev # or yarn dev # or bun run dev # or pnpm run dev
-
Clear view cache:
php artisan view:clear
-
Generate a theme (optional):
php artisan artisanpack:generate-theme
If you prefer to install the package manually, follow these steps:
# Install the package
composer require artisanpack-ui/livewire-ui-components
# Install Livewire
composer require livewire/livewire
# Optional: Install Volt
composer require livewire/volt
php artisan volt:install# Using npm
npm install --save-dev daisyui tailwindcss @tailwindcss/vite
# Or using yarn
yarn add -D daisyui tailwindcss @tailwindcss/vite
# Or using bun
bun i -D daisyui tailwindcss @tailwindcss/vite
# Or using pnpm
pnpm i -D daisyui tailwindcss @tailwindcss/viteUpdate your resources/css/app.css file to include:
@tailwind base;
@tailwind components;
@tailwind utilities;
/** daisyUI */
@plugin "daisyui" {
themes: light --default, dark --prefersdark;
}
/* Livewire UI Components */
@source "../../vendor/artisanpack-ui/livewire-ui-components/resources/views/**/*.php";
@source "../../vendor/artisanpack-ui/livewire-ui-components/src/View/Components/**/*.php";
/* Theme toggle */
@custom-variant dark (&:where(.dark, .dark *));
/**
* Paginator - Traditional style
* Because Laravel defaults does not match well the design of daisyUI.
*/
.artisanpack-table-pagination span[aria-current="page"] > span {
@apply bg-primary text-base-100
}
.artisanpack-table-pagination button {
@apply cursor-pointer
}php artisan vendor:publish --tag=livewire-ui-components.configIf you're using Jetstream, Breeze, or another UI package that might have components with the same names, the installer will automatically add a prefix to ArtisanPack UI components.
You'll see a message like:
---------------------------------------------
🚨`jetstream` was detected.🚨
---------------------------------------------
A global prefix on Livewire UI Components components was added to avoid name collision.
* Example: x-artisanpack-button, x-artisanpack-card ...
* See config/livewire-ui-components.php
---------------------------------------------
You can customize this prefix in the config/livewire-ui-components.php file.
If you encounter issues with asset compilation:
- Make sure you have the latest version of your package manager
- Clear your Node.js cache:
npm cache clean --force # or yarn cache clean - Delete
node_modulesand reinstall:rm -rf node_modules npm install
If components aren't displaying correctly:
php artisan view:clearArtisanPack UI Livewire Components is compatible with Jetstream. The installer will detect Jetstream and add a prefix to ArtisanPack UI components to avoid name collisions.
ArtisanPack UI Livewire Components is compatible with Breeze. The installer will detect Breeze and add a prefix to ArtisanPack UI components to avoid name collisions.
If you're using Livewire Flux, the installer will detect it and add a prefix to ArtisanPack UI components to avoid name collisions.