Installation:
composer require koverae/koverae-ui-builder
The package auto-registers its service provider and Blade directives.
Publish Config (if customization is needed):
php artisan vendor:publish --tag=koverae-ui-builder-config
Generate a Basic Component:
php artisan koverae:make-form login-form
This creates a Blade component (resources/views/components/login-form.blade.php) with a pre-configured form structure.
Use in Blade:
<x-login-form />
The component is now ready for customization via Blade slots or props.
Build a login form with validation and CSRF protection in 3 steps:
php artisan koverae:make-form auth/login
<x-auth.login>
<x-slot name="email">
<input type="email" name="email" required>
</x-slot>
<x-slot name="password">
<input type="password" name="password" required>
</x-slot>
</x-auth.login>
<x-auth.login action="{{ route('login') }}" />
php artisan koverae:make-form user/profile
php artisan koverae:make-table users-table
php artisan koverae:make-cart shopping-cart
Override default sections of components:
<x-user.profile>
<x-slot name="header">
<h1>Custom Header</h1>
</x-slot>
<x-slot name="actions">
<button>Save</button>
</x-slot>
</x-user.profile>
Pass data dynamically:
<x-users-table :users="$users" :columns="['id', 'name', 'email']" />
validate() method (if supported in future versions).@include or @component for shared UI snippets (e.g., modals, alerts).Laravel Mix/Vite:
Ensure your build system processes Blade components. Add to resources/js/app.js:
import './../../views/components/**/*.js';
Testing:
Use Laravel’s render() helper to test components:
$this->assertStringContainsString('Login', $this->render('components.auth.login'));
Livewire/Alpine.js: Combine with Livewire for dynamic forms:
<x-auth.login wire:model="formData">
<!-- Fields -->
</x-auth.login>
Tailwind CSS: Extend the package’s default styles by publishing assets:
php artisan vendor:publish --tag=koverae-ui-builder-assets
Then override in your tailwind.config.js.
Component Naming Collisions: Avoid naming conflicts with existing Blade components. Use namespaces:
php artisan koverae:make-form admin/user-form
Blade usage:
<x-admin.user-form />
Slot Overrides Not Working: Ensure slot names match exactly (case-sensitive). Debug with:
@dump($__env->slot('header'))
Dynamic Props Not Binding: Verify props are passed as arrays or objects:
<!-- Wrong -->
<x-users-table columns="id,name">
<!-- Correct -->
<x-users-table :columns="['id', 'name']" />
Asset Loading Issues:
If CSS/JS fails to load, check the published assets path in config/koverae-ui-builder.php.
Check Generated Files:
Components are created in resources/views/components/. Inspect for errors.
Enable Blade Debugging:
Add to AppServiceProvider:
Blade::setEchoFormat(function ($value) {
return "<!-- {{ $value }} -->";
});
Log Component Data:
Use @dd in Blade to inspect props/slots:
@dd($this->header)
Component Templates:
Use --template flag to customize scaffolding (if supported in future versions):
php artisan koverae:make-form login --template=auth
Partial Updates: For SPAs, combine with Inertia.js or Laravel Livewire for partial rendering.
Dark Mode: Extend the package’s theme system (if available) or override CSS variables:
@layer components {
.koverae-dark .btn-primary {
@apply bg-gray-800;
}
}
Version Pinning:
Pin the package version in composer.json to avoid breaking changes:
"koverae/koverae-ui-builder": "1.0.0"
Community Extensions: Monitor the repo for plugins (e.g., additional component types, integrations). Contribute if missing features are critical.
How can I help you explore Laravel packages today?