# Declaration

### `::make vs ::blade`

In a [Standard form](https://tina-hammar.gitbook.io/tall-forms/form/form-types/standard-form), [Modal](https://tina-hammar.gitbook.io/tall-forms/form/form-types/modal) or [Without button](https://tina-hammar.gitbook.io/tall-forms/form/form-types/without-buttons) forms, you use the `make()` method

```php
FooField::make(string $label, null|string $key = null)
```

In [Headless](https://tina-hammar.gitbook.io/tall-forms/form/form-types/headless) or [Fields only](https://tina-hammar.gitbook.io/tall-forms/form/form-types/untitled) forms you use the `blade()` method

```php
FooField::blade(
    string $label, 
    null|string $key = null, 
    string $wireId = '', 
    string $name = '', 
    string $id = ''
)
```

## Both ::make and ::blade params

### **`$label`**

*Required* The label to use for the form field, e.g. `First Name`.

### **`$key` (wire:model)**

*Optional.* The key to use for the form field. If null, it will use a snake cased `$label`. This parameter corresponds to the `$model` attribute and sets the **`wire:model`** attribute on the field.

Basic input example:

```php
 Input::make('First Name')->rules('required|min:2'),
```

Select field example

```php
$brand_options = Brand::orderBy('name')->pluck('id', 'name');

Select::make('Brand', 'brand_id')
    ->options($brand_options)
    ->rules(['required', Rule::exists('brands', 'id')])
```

## ::blade only params

### $id

*Optional.*  **The $id property overrides $wireId**. For [Headless](https://tina-hammar.gitbook.io/tall-forms/form/form-types/headless) or [Fields only](https://tina-hammar.gitbook.io/tall-forms/form/form-types/untitled) forms. Set the input html `id` attribute else, it will be auto-generated from the field `$key.`

```php
Input::blade(
    label: 'My input', 
    id: 'my-input-id'
)
```

### $wireId

*Optional.* **The $id property overrides $wireId**. For [Headless](https://tina-hammar.gitbook.io/tall-forms/form/form-types/headless) or [Fields only](https://tina-hammar.gitbook.io/tall-forms/form/form-types/untitled) forms. Pass the Livewire `$_instance->id` to get a component **unique** input html  `id`  else, it will be auto-generated from the field `$key.`

```php
Input::blade(
    label: 'My input', 
    wireId: $_instance->id,
)
```

### **$name**

*Optional.* For [Headless](https://tina-hammar.gitbook.io/tall-forms/form/form-types/headless) or [Fields only](https://tina-hammar.gitbook.io/tall-forms/form/form-types/untitled) forms. Set the input html `name` attribute else, it will be auto-generated from the field `$label.`

```php
Input::blade(
    label: 'My input', 
    name: 'my-input-name'
)
```
