Menu

## CountryForm extends Component
in package
uses LivewireAlert

CountryForm.php : 25

Class CountryForm

Livewire component responsible for creating and updating country records in the Admin Settings section.

This component handles:

- Country creation
- Country editing
- Form validation
- Success alerts

### Table of Contents

#### Properties

$countryEditId : int|string|null
  Country ID used for edit mode.
$iso_code : string|null
  Country ISO code.
$name : string|null
  Country name.
$short_name : string|null
  Country short name.
$status : int|string
  Country status (active/inactive).
$tel_prefix : string|null
  Country telephone prefix.

#### Methods

mount() : void
  Lifecycle hook executed when the component is mounted.
render() : View
  Render the Livewire component view.
submitCountry() : RedirectResponse
  Handle country form submission.

### Properties

#### $countryEditId

CountryForm.php : 74

Country ID used for edit mode.

`public int|string|null $countryEditId`

#### $iso_code

CountryForm.php : 50

Country ISO code.

`public string|null $iso_code`

##### Attributes

#[Rule]
  'required'

#### $name

CountryForm.php : 34

Country name.

`public string|null $name`

##### Attributes

#[Rule]
  'required'

#### $short_name

CountryForm.php : 42

Country short name.

`public string|null $short_name`

##### Attributes

#[Rule]
  'required'

#### $status

CountryForm.php : 66

Country status (active/inactive).

`public int|string $status = 1`

##### Attributes

#[Rule]
  'required'

#### $tel_prefix

CountryForm.php : 58

Country telephone prefix.

`public string|null $tel_prefix`

##### Attributes

#[Rule]
  'required'

### Methods

#### mount()

CountryForm.php : 85

Lifecycle hook executed when the component is mounted.

`public mount(int|string|null $id) : void`

Loads country details for edit mode and populates form fields accordingly.

##### Parameters

$id : int|string|null

  Country ID

#### render()

CountryForm.php : 139

Render the Livewire component view.

`public render() : View`

Displays the country create/edit form.

##### Return values

View

#### submitCountry()

CountryForm.php : 109

Handle country form submission.

`public submitCountry() : RedirectResponse`

Validates input data and performs:

- Country update (if editing)
- Country creation (if new)

Displays success alerts and redirects back to the countries listing page.

##### Return values

RedirectResponse

## Search results