composer require talalalmrka/fgx in your Laravel project.php artisan vendor:publish --tag=fgx-config to generate the config file (though minimal config is required).<fgx:alert type="success" message="Welcome to your dashboard!" />
config/fgx.php for customization options (e.g., default styles, class prefixes).@fgxStyle) for global styling.Component Integration:
<fgx:component> syntax for all provided components (e.g., <fgx:button>).:disabled="true", @click="handleClick").<fgx:card>
<h3>Custom Title</h3>
<p>Custom content</p>
</fgx:card>
Reusable UI Logic:
config/fgx.php:
'styles' => [
'prefix' => 'fgx-', // Customize class prefixes
'theme' => 'light', // e.g., 'dark', 'custom'
],
Card + Table + Button for a dashboard tile).Form Handling:
<fgx:input> for forms with built-in validation feedback:
<fgx:input
name="email"
label="Email"
:errors="$errors->get('email')"
required
/>
<fgx:dropdown> with options:
<fgx:dropdown
name="category"
:options="$categories"
label="Select Category"
/>
State Management:
<fgx:modal> for dynamic content (e.g., confirmations, forms):
<fgx:modal wire:model="isModalOpen">
<h3>Confirm Action</h3>
<p>Are you sure?</p>
<template #footer>
<fgx:button type="primary" @click="confirmAction">Yes</fgx:button>
</template>
</fgx:modal>
// In a Livewire component
public function showSuccess() {
$this->dispatch('alert', type: 'success', message: 'Saved!');
}
Livewire Integration:
<fgx:input wire:model="form.email" />
<fgx:button @click="$wire.submitForm">Submit</fgx:button>
Testing:
$this->blade('<fgx:alert type="success" message="Test" />')
->assertSee('Operation completed successfully!');
$this->livewire(ModalComponent::class)
->assertSee('Confirm Action');
Missing Config:
vendor:publish is skipped.php artisan vendor:publish --tag=fgx-config and review config/fgx.php.Prop Validation:
type="invalid") may throw errors or render unpredictably.type="success|error|warning|info"). Check the Usage section for allowed values.Caching:
php artisan view:clear
php artisan config:clear
Slot Limitations:
#footer).<fgx:modal>) for slot usage.Livewire Conflicts:
@this or $wire directives may conflict with component props.<fgx:input wire:model.defer="form.email" />
Asset Loading:
@fgxStyles
@fgxScripts
Inspect Rendered HTML:
fgx-alert fgx-alert--success).Check for Deprecations:
Fallback Classes:
.alert, .alert-success) to debug.Log Props:
render() method to verify data:
public function render() {
\Log::info('Props:', $this->props);
return view('fgx::alert', $this->props);
}
Custom Components:
resources/views/vendor/fgx/alert.blade.php) to create variants.New Components:
resources/views/vendor/fgx/new-component.blade.php).Dynamic Styling:
.fgx-alert {
--fgx-alert-bg: #333;
--fgx-alert-color: #fff;
}
JavaScript Enhancements:
<fgx:dropdown x-data="{ open: false }" @click.away="open = false">
<!-- Options -->
</fgx:dropdown>
Configuration Overrides:
config/fgx.php:
'defaults' => [
'alert_type' => 'info', // Default alert type
'button_variant' => 'primary', // Default button style
],
How can I help you explore Laravel packages today?