Menu

## Detail extends Component
in package
uses HandlesGuzzleRequests

Detail.php : 29

Class Detail

Livewire component responsible for displaying add-on details and handling the purchase flow in the Admin panel.

This component:

- Fetches add-on details
- Loads available payment gateways
- Handles add-on purchase requests
- Redirects to payment gateways (Razorpay / Bank)

### Table of Contents

#### Properties

$addon_detail : array<string|int, mixed>|null
  Add-on detail response data.
$addon_id : int|string|null
  Add-on identifier.
$addon_slug : string|null
  Add-on unique slug.
$amount : float|int|null
  Add-on purchase amount.
$gatewayname : string|null
  Selected payment gateway name.
$isProcessing : bool
  Indicates whether the purchase process is currently running.
$payment_gateway : int|string|null
  Selected payment gateway ID.
$paymentgateway_detail : array<string|int, mixed>|null
  Selected payment gateway detailed information.
$paymentgateways : array<string|int, mixed>
  List of available payment gateways.
$user : Authenticatable|null
  Currently authenticated user.

#### Methods

buyAddon() : RedirectResponse|void
  Handle add-on purchase action.
getAddonDetail() : array<string|int, mixed>|null
  Fetch add-on details from external API.
getPaymentgateways() : array<string|int, mixed>|null
  Fetch available payment gateways from API.
guzzleImagePost() : ResponseInterface
  Perform a POST request that can send files using multipart/form-data.
mount() : void
  Lifecycle hook executed when the component is mounted.
paymentGatewayChange() : void
  Handle payment gateway change event.
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_detail

Detail.php : 73

Add-on detail response data.

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

#### $addon_id

Detail.php : 38

Add-on identifier.

`public int|string|null $addon_id`

#### $addon_slug

Detail.php : 103

Add-on unique slug.

`public string|null $addon_slug`

#### $amount

Detail.php : 66

Add-on purchase amount.

`public float|int|null $amount`

#### $gatewayname

Detail.php : 87

Selected payment gateway name.

`public string|null $gatewayname`

#### $isProcessing

Detail.php : 96

Indicates whether the purchase process is currently running.

`public bool $isProcessing = false`

Used to prevent duplicate submissions.

#### $payment_gateway

Detail.php : 52

Selected payment gateway ID.

`public int|string|null $payment_gateway`

#### $paymentgateway_detail

Detail.php : 80

Selected payment gateway detailed information.

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

#### $paymentgateways

Detail.php : 45

List of available payment gateways.

`public array<string|int, mixed> $paymentgateways = []`

#### $user

Detail.php : 59

Currently authenticated user.

`public Authenticatable|null $user`

### Methods

#### buyAddon()

Detail.php : 152

Handle add-on purchase action.

`public buyAddon() : RedirectResponse|void`

- Prevents duplicate requests
- Validates payment gateway selection
- Creates add-on purchase entry
- Initiates payment gateway flow

##### Return values

RedirectResponse|void

#### getAddonDetail()

Detail.php : 238

Fetch add-on details from external API.

`public getAddonDetail() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null

#### getPaymentgateways()

Detail.php : 261

Fetch available payment gateways from API.

`public getPaymentgateways() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null

#### 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()

Detail.php : 116

Lifecycle hook executed when the component is mounted.

`public mount(string $slug) : void`

Initializes:

- Authenticated user
- Payment gateways
- Add-on details using slug

##### Parameters

$slug : string

  Add-on slug

#### paymentGatewayChange()

Detail.php : 217

Handle payment gateway change event.

`public paymentGatewayChange() : void`

Loads additional payment gateway details when the selected gateway requires it (e.g., bank transfer).

#### render()

Detail.php : 132

Render the Livewire component view.

`public render() : View`

Passes add-on details, features, contact details, and payment gateways 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