DynamicSelect
extends Component
in package
DynamicSelect Laravel Blade Component
A dynamic select input component that fetches options from a specified route. Supports customizable labels, hints, and placeholder text for enhanced user experience.
Features:
- Dynamic option loading from a given route
- Customizable labels and hints
- Placeholder support
- Form validation integration
- Livewire real-time updates
- Bulma CSS framework integration
- Mobile-friendly responsive design
Tags
Table of Contents
- $child : string
- $class : string
- $hint : string|null
- $icon : string|null
- $id : string
- $label : string|null
- $name : string
- $options : mixed
- $placeholder : string|null
- $route : mixed
- $value : string|null
- __construct() : mixed
- Create a new component instance
- render() : View|string
- Get the view / contents that represent the component.
Properties
$child
public
string
$child
$class
public
string
$class
$hint
public
string|null
$hint
= null
$icon
public
string|null
$icon
= null
$id
public
string
$id
$label
public
string|null
$label
= null
$name
public
string
$name
$options
public
mixed
$options
$placeholder
public
string|null
$placeholder
= null
$route
public
mixed
$route
$value
public
string|null
$value
= null
Methods
__construct()
Create a new component instance
public
__construct(string $name, mixed $route, string $child[, mixed $options = [] ][, string|null $value = null ][, string|null $id = null ][, mixed $label = null ][, string|null $classes = null ][, string $placeholder = 'Select' ][, string|null $hint = null ][, string|null $icon = null ]) : mixed
Parameters
- $name : string
- $route : mixed
-
- route name or array with route name and parameters
- $child : string
-
- child key in the response data
- $options : mixed = []
-
- options for the select, can be an array or a Collection
- $value : string|null = null
-
- selected value
- $id : string|null = null
-
- HTML id attribute
- $label : mixed = null
-
- label for the select, can be a string or false to hide it
- $classes : string|null = null
-
- additional CSS classes for the select
- $placeholder : string = 'Select'
-
- placeholder text for the select
- $hint : string|null = null
-
- hint text to display below the select
- $icon : string|null = null
-
- icon to display in the select
Return values
mixed —render()
Get the view / contents that represent the component.
public
render() : View|string