Foundation package providing base components, utilities, and contracts for all Laravilt packages. Build custom components with reusable traits, utilities, and base classes.
- 🏗️ Base Component - Foundation for all UI components
- 🎨 Concerns - 11+ reusable component behaviors (traits)
- 🛠️ Utilities - Get, Set, Str, Arr helpers
- 📝 Contracts - Interfaces for consistent implementations
- 🔄 Serialization - Multi-platform support
| Trait | Description |
|---|---|
CanBeDisabled | Enable/disable component state |
CanBeHidden | Conditional visibility control |
HasActions | Action button support |
HasColor | Color theming (primary, success, danger, etc.) |
HasDescription | Description/helper text |
HasIcon | Icon display support |
HasId | Unique identifier management |
HasLabel | Label configuration |
HasName | Name attribute handling |
HasPlaceholder | Placeholder text |
InteractsWithState | State management utilities |
useLaravilt\Support\Component;
useLaravilt\Support\Concerns\HasLabel;
useLaravilt\Support\Concerns\HasIcon;
useLaravilt\Support\Concerns\HasColor;
class MyComponent extends Component
{
use HasLabel;
use HasIcon;
use HasColor;
publicstaticfunctionmake(string$name): static
{
returnapp(static::class, ['name' => $name]);
}
}
// Usage
MyComponent::make('action')
->label('Click Me')
->icon('plus')
->color('primary');useLaravilt\Support\Get;
useLaravilt\Support\Set;
useLaravilt\Support\Str;
// Dot notation access
Get::value($array, 'nested.key', 'default');
Set::value($array, 'nested.key', 'value');
// String utilities
Str::slug('My Component'); // 'my-component'composer require laravilt/supportphp artisan make:component RatingInput- Complete Documentation - Base components, concerns, utilities
- MCP Server Guide - AI agent integration
The MIT License (MIT). Please see License File for more information.
