Customers

Events

Overview of WHAM Customer Events

The Toolstation\Customers\Events namespace contains various events that facilitate the management of customer accounts and interactions. Events such as CustomerUpdated, CustomerNoteCreated, and CustomerIssueCreated notify the application of changes and actions related to customer data, including updates to customer information, notes, and issues. Additionally, events like CustomerAddressCreated, CustomerAddressUpdated, and CustomerAddressDeleted track changes to customer addresses, while NoteAddedToCustomerIssue and CustomerIssueClosed enhance issue management by updating the status and context of customer concerns. Overall, these events enable efficient tracking and responsive actions throughout the customer lifecycle, ensuring that the system remains accurate and up-to-date.


The customer module fires the following events.

Class NameEvent
Toolstation\Customers\Events\CustomerUpdatedFired when a customer is updated
Toolstation\Customers\Events\CustomerNoteCreatedFired when a new note is created on a customers account
Toolstation\Customers\Events\CustomerNoteUpdatedFired when a note is updated on a customers account
Toolstation\Customers\Events\CustomerIssueCreatedFired when an issue is created on a customers account
Toolstation\Customers\Events\NoteAddedToCustomerIssueFired when a note is created on a customer issue
Toolstation\Customers\Events\CustomerIssueNoteUpdatedFired when a note on a customer issue is updated
Toolstation\Customers\Events\CustomerIssueClosedFired when a customer issue is closed
Toolstation\Customers\Events\CatalogueRequestCreatedFired when a catalogue request is created
Toolstation\Customers\Events\CustomerAttributeCreatedFired when a customer attribute is created
Toolstation\Customers\Events\CustomerAddressCreatedFired when a customer address is created
Toolstation\Customers\Events\CustomerAddressUpdatedFired when a customer address is updated
Toolstation\Customers\Events\CustomerAddressDeleted Fired when a customer address is deleted

CustomerUpdated Event

The CustomerUpdated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a customer's details are updated. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $customer, which is of type Customer. This property holds the instance of the customer that has been updated, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a Customer instance as a parameter and assigns it to the $customer property. This provides the event with the specific customer information that has been modified, enabling listeners to react accordingly.

Note: This event is fired when a customer is updated.


CustomerNoteCreated Event

The CustomerNoteCreated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a new note has been created for a customer. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $customerNote, which is of type CustomerNote. This property holds the instance of the customer note that has been created, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CustomerNote instance as a parameter and assigns it to the $customerNote property. This provides the event with the specific customer note information that has been added, enabling listeners to react accordingly.

Note: This event is fired when a new note is created on a customer's account.


CustomerNoteUpdated Event

The CustomerNoteUpdated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a note on a customer's account is updated. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $customerNote, which is of type CustomerNote. This property holds the instance of the customer note that has been updated, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CustomerNote instance as a parameter and assigns it to the $customerNote property. This provides the event with the specific customer note information that has been modified, enabling listeners to react accordingly.

Note: This event is fired when a note is updated on a customer's account.


CustomerIssueCreated Event

The CustomerIssueCreated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when an issue is created on a customer's account. Below is a breakdown of its key elements:

Key Elements

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Properties:
  • $customerIssue: A public property of type CustomerIssue, which holds the instance of the customer issue that has been created.
  • $collectionSite: A public property of type SystemSite|null, which represents the collection site associated with the customer issue. This property is optional and can be null.
  • $supplierEmail: A public property of type string|null, which holds the supplier's email address associated with the customer issue. This property is also optional and can be null.
  1. Constructor:
  • The constructor method accepts three parameters: a CustomerIssue instance, an optional SystemSite instance (for the collection site), and an optional string (for the supplier email). These parameters are assigned to their respective properties, allowing the event to carry relevant information about the created issue.

Note: This event is fired when an issue is created on a customer's account.

NoteAddedToCustomerIssue Event

The NoteAddedToCustomerIssue class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a note is added to a customer issue. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $customerIssue, which is of type CustomerIssue. This property holds the instance of the customer issue to which a note has been added, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CustomerIssue instance as a parameter and assigns it to the $customerIssue property. This provides the event with the specific customer issue information, enabling listeners to react accordingly.

Note: This event is fired when a note is created on a customer issue.


CustomerIssueNoteUpdated Event

The CustomerIssueNoteUpdated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a note on a customer issue is updated. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $customerIssueNote, which is of type CustomerIssueNote. This property holds the instance of the customer issue note that has been updated, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CustomerIssueNote instance as a parameter and assigns it to the $customerIssueNote property. This provides the event with the specific customer issue note information that has been modified, enabling listeners to react accordingly.

Note: This event is fired when a note on a customer issue is updated.


CustomerIssueClosed Event

The CustomerIssueClosed class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a customer issue is closed. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $customerIssue, which is of type CustomerIssue. This property holds the instance of the customer issue that has been closed, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CustomerIssue instance as a parameter and assigns it to the $customerIssue property. This provides the event with the specific customer issue information, enabling listeners to react accordingly.

Note: This event is fired when a customer issue is closed.


CatalogueRequestCreated Event

The CatalogueRequestCreated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a catalogue request is created. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $catalogueRequest, which is of type CatalogueRequest. This property holds the instance of the catalogue request that has been created, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CatalogueRequest instance as a parameter and assigns it to the $catalogueRequest property. This provides the event with the specific catalogue request information, enabling listeners to react accordingly.

Note: This event is fired when a catalogue request is created.


CustomerAttributeCreated Event

The CustomerAttributeCreated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a customer attribute is created. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $customerAttribute, which is of type CustomerAttribute. This property holds the instance of the customer attribute that has been created, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CustomerAttribute instance as a parameter and assigns it to the $customerAttribute property. This provides the event with the specific customer attribute information, enabling listeners to react accordingly.

Note: This event is fired when a customer attribute is created.


CustomerAddressCreated Event

The CustomerAddressCreated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a customer address is created. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $customerAddress, which is of type CustomerAddress. This property holds the instance of the customer address that has been created, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CustomerAddress instance as a parameter and assigns it to the $customerAddress property. This provides the event with the specific customer address information, enabling listeners to react accordingly.

Note: This event is fired when a customer address is created.


CustomerAddressUpdated Event

The CustomerAddressUpdated class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a customer address is updated. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instances can be properly handled by queued jobs.
  1. Properties:
  • The class includes two public properties:
    • $newAddress: This property is of type CustomerAddress and holds the instance of the newly updated customer address.
    • $expiredAddress: This property is also of type CustomerAddress and holds the instance of the customer address that has been replaced or expired.
  1. Constructor:
  • The constructor method accepts two CustomerAddress instances as parameters—$expiredAddress and $newAddress—and assigns them to the respective properties. This provides the event with the specific address information, enabling listeners to react accordingly.

Note: This event is fired when a customer address is updated.


CustomerAddressDeleted Event

The CustomerAddressDeleted class is an event defined in the Toolstation\Customers\Events namespace. This event is designed to notify other parts of the application when a customer address is deleted. Below is a breakdown of its key elements:

Key Elements:

  1. Namespace:
  • The class is located within the Toolstation\Customers\Events namespace, indicating its relevance to customer-related events within the Toolstation application.
  1. Use Statement:
  • The class uses the SerializesModels trait from Laravel. This trait enables the serialization of Eloquent models when the event is queued for processing, ensuring that the model instance can be properly handled by queued jobs.
  1. Property:
  • The class includes a public property, $address, which is of type CustomerAddress. This property holds the instance of the customer address that has been deleted, allowing it to be accessed by any event listeners that respond to this event.
  1. Constructor:
  • The constructor method accepts a CustomerAddress instance as a parameter and assigns it to the $address property. This provides the event with the specific address information, enabling listeners to react accordingly.

Note: This event is fired when a customer address is deleted.


Copyright © 2026