Menu

## AddOnList extends Component
in package
uses HandlesGuzzleRequests

AddOnList.php : 22

Class AddOnList

Livewire component responsible for displaying the list of Add-ons in the Admin panel with pagination.

Fetches add-on data from external API using Guzzle and handles page navigation.

### Table of Contents

#### Properties

$addon : array<string|int, mixed>|null
  Stores API response containing add-on list data.
$currentPage : int
  Current pagination page number.

#### Methods

getAddons() : array<string|int, mixed>|null
  Fetch add-ons list from the external API.
goToPage() : void
  Navigate to a specific pagination page.
guzzleImagePost() : ResponseInterface
  Perform a POST request that can send files using multipart/form-data.
mount() : void
  Lifecycle hook executed when the component is mounted.
render() : View
  Render the Livewire component view.
guzzleGet() : array<string|int, mixed>|null
  Perform a GET request using Guzzle and return decoded JSON.
guzzlePost() : array<string|int, mixed>|null
  Perform a POST request using Guzzle and return decoded JSON.

### Properties

#### $addon

AddOnList.php : 31

Stores API response containing add-on list data.

`public array<string|int, mixed>|null $addon`

#### $currentPage

AddOnList.php : 38

Current pagination page number.

`public int $currentPage = 1`

### Methods

#### getAddons()

AddOnList.php : 76

Fetch add-ons list from the external API.

`public getAddons(int $page) : array<string|int, mixed>|null`

##### Parameters

$page : int

  Current page number

##### Return values

array<string|int, mixed>|null —

API response data

#### goToPage()

AddOnList.php : 103

Navigate to a specific pagination page.

`public goToPage(int $page) : void`

Ensures page number stays within valid limits and refreshes the add-on list accordingly.

##### Parameters

$page : int

#### guzzleImagePost()

HandlesGuzzleRequests.php : 79

Perform a POST request that can send files using multipart/form-data.

`public guzzleImagePost(string $url[, array<string|int, mixed> $data = [] ][, bool $hasFile = false ]) : ResponseInterface`

##### Parameters

$url : string

  Endpoint URL

$data : array<string|int, mixed> = []

  Form data or files

$hasFile : bool = false

  Whether the payload includes uploaded files

##### Return values

ResponseInterface

#### mount()

AddOnList.php : 47

Lifecycle hook executed when the component is mounted.

`public mount() : void`

Fetches initial add-on data for the first page.

#### render()

AddOnList.php : 59

Render the Livewire component view.

`public render() : View`

Passes add-on list and pagination data to the Blade view.

##### Return values

View

#### guzzleGet()

HandlesGuzzleRequests.php : 16

Perform a GET request using Guzzle and return decoded JSON.

`protected guzzleGet(string $url[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|null`

##### Parameters

$url : string

  Endpoint URL

$params : array<string|int, mixed> = []

  Query parameters

##### Return values

array<string|int, mixed>|null —

Decoded response or null on failure

#### guzzlePost()

HandlesGuzzleRequests.php : 46

Perform a POST request using Guzzle and return decoded JSON.

`protected guzzlePost(string $url[, array<string|int, mixed> $data = [] ][, bool $asJson = false ]) : array<string|int, mixed>|null`

##### Parameters

$url : string

  Endpoint URL

$data : array<string|int, mixed> = []

  Payload data

$asJson : bool = false

  When true sends JSON, otherwise form-params

##### Return values

array<string|int, mixed>|null —

Decoded response or null on failure

## Search results