Installation:
composer require allyoullneed/advanced-controls
Publish the package assets (if needed):
php artisan vendor:publish --provider="Allyoullneed\AdvancedControls\AdvancedControlsServiceProvider" --tag="public"
First Use Case:
Replace a basic Blade form input with an enhanced component. For example, swap a standard <select> for the Select component:
@select([
'name' => 'category',
'label' => 'Select a category',
'options' => [
'tech' => 'Technology',
'design' => 'Design',
'business' => 'Business',
],
'wire:model' => 'categoryId',
])
Where to Look First:
resources/views/vendor/advanced-controls directory for Blade templates.app/Http/Livewire directory for example components if using Livewire.Form Enhancement: Replace standard form elements with interactive components:
@checkbox([
'name' => 'subscribe',
'label' => 'Subscribe to newsletter',
'wire:model' => 'newsletter',
'labelPosition' => 'right',
])
Dynamic UI with Livewire:
Use wire:model for two-way binding:
@tabs([
'wire:model' => 'activeTab',
'tabs' => [
['name' => 'home', 'label' => 'Home'],
['name' => 'profile', 'label' => 'Profile'],
],
])
Conditional Rendering:
Combine with Blade @if directives:
@if(auth()->check())
@avatar([
'src' => auth()->user()->avatar,
'name' => auth()->user()->name,
'size' => 'md',
])
@endif
Configuration Overrides:
Customize global settings in config/advanced-controls.php:
'icons' => [
'set' => 'heroicons',
'cdn' => 'https://cdn.jsdelivr.net/npm/heroicons@2.0.18',
],
Chart Integration: Load charts dynamically with CDN configuration:
@chart([
'type' => 'line',
'data' => $chartData,
'options' => ['responsive' => true],
'cdn' => 'chartjs',
])
public function mount() {
$this->activeTab = 'home';
}
@click).@error('categoryId')
<div class="error-message">{{ $message }}</div>
@enderror
Component Registration:
AdvancedControlsServiceProvider. If using Artisan commands, verify the fix from PR #12 is applied.Livewire Model Binding:
Select, Tabs, and other components, ensure wire:model is correctly bound to a Livewire property (fixed in PR #10).Icon Dependencies:
config/advanced-controls.php.Chart Loading:
config/advanced-controls.php) and the component is rendered after the DOM is ready.Alpine.js Conflicts:
Rating) removed Alpine.js dependencies in PR #1. Avoid mixing Alpine.js directives unless documented.php artisan vendor:publish --tag="public"
@dd() to inspect passed data:
@dd($componentData)
wire:model properties exist in the Livewire component class.Customization:
resources/views/vendor/advanced-controls to tailor components to your theme.Performance:
<div x-data="{ loadChart: false }" x-init="loadChart = true">
@chart([...])
</div>
Accessibility:
aria-* attributes manually if components lack them:@select([...])
<span aria-hidden="true">↓</span>
@endselect
Testing:
render() method:$this->render();
Capture Blade output with ob_start() and ob_get_clean().
Extensions:
app/View/Components/AdvancedControlsComponent.php. Example:namespace App\View\Components;
use Allyoullneed\AdvancedControls\AdvancedControlsComponent;
class CustomSelect extends AdvancedControlsComponent {
public $options;
// ...
}
How can I help you explore Laravel packages today?