### Instantiating CityPlanFact PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/PlanFact/City/CityPlanFact.md This snippet provides an example of how to create a new instance of the CityPlanFact class, passing DateTime objects for start and end dates and a City instance. ```php $start = new \DateTime('2023-01-01'); $end = new \DateTime('2023-12-31'); $city = new City(); // Assuming you have a City instance $cityPlanFact = new CityPlanFact($start, $end, $city); ``` -------------------------------- ### Installing Bitrix24 App with Parameters PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/BitrixCRest/CRest.md Shows how to call the static `installApp` method with an associative array `$request` containing explicit authorization and domain details required for the installation. ```php $request = [ 'AUTH_ID' => 'your_auth_id', 'AUTH_EXPIRES' => 'expiry_time', 'APP_SID' => 'your_app_sid', 'REFRESH_ID' => 'your_refresh_id', 'DOMAIN' => 'your_domain' ]; $result = CRest::installApp($request); ``` -------------------------------- ### Instantiating ZvonobotIVR Example PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Zvonobot/ZvonobotIVR.md Provides an example of how to create a new ZvonobotIVR object. It shows the creation of dependent ZvonobotRecord and ZvonobotSMS objects and passing them along with required ID and keywords to the constructor. ```php $voiceMessage = new ZvonobotRecord(/* parameters */); $smsMessage = new ZvonobotSMS(/* parameters */); $ivr = new ZvonobotIVR(1, 'hello,world', $voiceMessage, $smsMessage, 'https://example.com/webhook'); ``` -------------------------------- ### Installing Bitrix24 App PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/BitrixCRest/CRest.md Demonstrates a basic call to the static `installApp` method of the `CRest` class to perform the application installation process, likely using default or previously configured parameters. ```php $result = CRest::installApp(); ``` -------------------------------- ### Example Usage of Getting Channel Information (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Telegram/Channel.md This example shows how to call the `getInfo` method on a `Channel` instance to fetch information about the channel. It then uses `print_r` to display the retrieved information, demonstrating how to access channel details. ```php $channel = new Channel($api, '123456'); $info = $channel->getInfo(); print_r($info); // Outputs channel information ``` -------------------------------- ### Example Usage of NewBitrixApi PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/BitrixAPI/NewBitrixApi.md This example demonstrates a typical sequence of operations using the `NewBitrixApi` class. It shows how to fetch and save statuses locally, retrieve a status name from local data, and fetch and save users to the database. ```php // Get and save statuses $savedStatuses = NewBitrixApi::getAndSaveStatusesLocal(); // Get a status name by ID $statusName = NewBitrixApi::getStatusNameByIdLocal('STATUS_ID'); // Get and save users NewBitrixApi::getAndSaveUsers(); ``` -------------------------------- ### Example Calculating and Displaying Task Statistics PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Helpers/ReanimationHelper.md A comprehensive example showing the workflow of using `ReanimationHelper` to get statistics for a task. It includes instantiating the helper, finding a task by ID, calling `getTaskStats()`, and printing the results (reanimated, non-reanimated, total contacts, and reanimation speed) to standard output. ```php $helper = new ReanimationHelper(); $task = ZvonokBulkTask::find(1); // Example task ID $taskStats = $helper->getTaskStats($task); echo "Reanimated Contacts: " . $taskStats['reanimated']; echo "Non-Reanimated Contacts: " . $taskStats['non_reanimated']; echo "Total Contacts: " . $taskStats['total']; echo "Reanimation Speed: " . $taskStats['speed'] . " contacts per minute"; ``` -------------------------------- ### Example Usage of Getting Channel Peer (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Telegram/Channel.md This example illustrates how to create a `Channel` object and then invoke the `peer` method. It shows the expected output format for the channel peer identifier, useful for constructing API requests. ```php $channel = new Channel($api, '123456'); echo $channel->peer(); // Outputs: channel#123456 ``` -------------------------------- ### Requesting Place Suggestions HTTP GET Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/DistanceController.md This HTTP GET request example demonstrates how to query the API endpoint to get suggestions for places based on a search string. The query string is passed as a URL parameter named 'query'. ```HTTP GET /api/place-suggestions?query=London ``` -------------------------------- ### Executing BalanceRequest and Getting Response PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Sms/Requests/BalanceRequest.md This example shows how to call the `execute` method on a `BalanceRequest` instance to send the request and retrieve the response. The response is then echoed. ```php $response = $balanceRequest->execute(); echo $response; ``` -------------------------------- ### Example Usage of Inviting Users to Channel (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Telegram/Channel.md This example demonstrates calling the `inviteToChannel` method on a `Channel` instance. It shows how to pass an array of user identifiers to the method to invite multiple users simultaneously to the specified channel. ```php $channel = new Channel($api, '123456'); $channel->inviteToChannel(['user1', 'user2']); ``` -------------------------------- ### Dispatching UserRegistered Event Example PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Events/UserRegistered.md Provides an example of how to create an instance of the UserRegistered event and dispatch it using the application's event system. It shows how to fetch a user, assign a role code, instantiate the event, and call the global 'event' helper function. ```php use App\Events\UserRegistered; use App\Models\User; // Assuming you have a user instance $user = User::find(1); // Fetch user with ID 1 $roleCode = 'admin'; // Assigning an admin role // Create an instance of the UserRegistered event $event = new UserRegistered($user, $roleCode); // Dispatch the event (assuming you have an event dispatcher set up) event($event); ``` -------------------------------- ### Example Broadcast Channel Return Type (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Events/MainContractCreated.md Shows an example of the return type for the `broadcastOn` method, illustrating that it returns a `Channel` instance, such as a `PrivateChannel`. ```php return new PrivateChannel('channel-name'); ``` -------------------------------- ### Example Usage of Getting Channel ID (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Telegram/Channel.md This example demonstrates how to create a `Channel` object and call the `getId` method to retrieve the channel's unique identifier. It shows the basic steps for accessing the channel ID after instantiation. ```php $channel = new Channel($api, '123456'); echo $channel->getId(); // Outputs: 123456 ``` -------------------------------- ### Example Usage of Leaving Channel (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Telegram/Channel.md This example shows a basic usage of the `leaveChannel` method. It demonstrates calling the method on a `Channel` instance to initiate the action of leaving the Telegram channel associated with that instance. ```php $channel = new Channel($api, '123456'); $channel->leaveChannel(); ``` -------------------------------- ### Starting General Call using UisAPI (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Uiscom/UisAPI.md This snippet demonstrates how to use the static `call()` method of the `UisAPI` class to initiate a general call to a specified phone number. It requires the target phone number, the line to use (using UisAPI constants), the employee's ID, and an optional message. ```php $result = UisAPI::call('73012599690', UisAPI::LINE_VDK, 101, 'Hello, this is a test call.'); ``` -------------------------------- ### Complete Notification Workflow Example (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Notifications/Zvonok/NeedPayemntZvonokNotification.md Demonstrates the typical sequence of creating a NeedPayemntZvonokNotification instance with a contract ID, obtaining a notifiable object, calling toZvonok to get the message, and then checking if the message object exists before attempting to send it. This represents a simplified end-to-end usage scenario. ```php $contract_id = 1; // Идентификатор контракта $notification = new NeedPayemntZvonokNotification($contract_id); $notifiable = // Получите объект получателя уведомления $message = $notification->toZvonok($notifiable); if ($message) { // Отправка сообщения через канал Zvonok } ``` -------------------------------- ### Getting Bitrix API Client PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/BitrixAPI/NewBitrixApi.md This static method creates and returns an instance of the underlying `Bitrix24API` client used by the class. It serves as the entry point for accessing Bitrix API functionalities through the wrapper. ```php $client = NewBitrixApi::getClient(); ``` -------------------------------- ### Initializing MarketingSourceAnalytic PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Marketing/MarketingSourceAnalytic.md This snippet demonstrates how to create a new instance of the `MarketingSourceAnalytic` class. It requires a time period (start and end dates) and optionally accepts a marketing source ID. ```php $period = ['2023-01-01', '2023-12-31']; $source_id = 1; $analytics = new MarketingSourceAnalytic($period, $source_id); ``` -------------------------------- ### Extending LeadMigrationRule and Applying Custom Logic (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/LeadMigrationRule/LeadMigrationRule.md This example illustrates how to create a subclass, `CustomLeadMigrationRule`, that extends the base `LeadMigrationRule` class. It defines a placeholder method `applyRule` for implementing specific migration logic and shows how to instantiate and use this custom rule. ```php namespace App\Domain\LeadMigrationRule; class CustomLeadMigrationRule extends LeadMigrationRule { public function applyRule() { // Implement your custom lead migration logic here } } // Usage of the subclass $customRule = new CustomLeadMigrationRule(); $customRule->applyRule(); ``` -------------------------------- ### Example Usage of Sending Message to Channel (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Telegram/Channel.md This example demonstrates calling the `sendMessage` method on a `Channel` instance. It shows how to pass a string containing the message content that should be sent to the Telegram channel. ```php $channel = new Channel($api, '123456'); $channel->sendMessage('Hello, Channel!'); ``` -------------------------------- ### Logging Migration Events (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Services/GoogleDriveMigrationService.md This snippet provides examples of how the service uses Laravel's `Log` facade to record events. It shows logging an informational message at the start of migration with the contract ID and logging an error message, including the error details and contract ID. ```php Log::info('Starting Google Drive migration', ['contract_id' => $this->contractId]); Log::error('Migration failed', ['contract_id' => $this->contractId, 'error' => $e->getMessage()]); ``` -------------------------------- ### Instantiating TestNotification Class PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Notifications/TestNotification.md Provides a basic example of how to create a new instance of the `TestNotification` class, demonstrating the required parameter for the constructor. ```php $notification = new TestNotification("This is a test notification!"); ``` -------------------------------- ### Installing Guzzle Dependency via Composer (Bash) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Uiscom/CallAPI.md This command installs the Guzzle HTTP client library using Composer, which is a required dependency for the CallAPI class to function. It should be executed in the root directory of your PHP project. ```bash composer require guzzlehttp/guzzle ``` -------------------------------- ### Instantiating BalanceRequest PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Sms/Requests/BalanceRequest.md This example demonstrates how to create a new instance of the `BalanceRequest` class in PHP. It initializes the object with a placeholder API key and sets the repeat count to 3. ```php $apiKey = 'your_api_key_here'; $balanceRequest = new BalanceRequest($apiKey, 3); ``` -------------------------------- ### Example Payments List Response - JSON Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PaymentsController.md Provides an example JSON structure for the response when requesting the list of payments via the `/payments/list` endpoint. It shows an array of payment objects with details like ID, amount, status, client, etc. ```json { "payments": [ { "id": 1, "city": "City Name", "contract_id": 123, "pay_at": "2023-10-01", "payment_type": "Type A", "payment_status": "New", "amount": 1000, "account_manager": "Manager Name", "client": "Client Full Name", "payment_account": "Account Name", "is_editable": true, "comment": "Payment comment", "service": "Service Title", "planfact_invoice_id": null } ] } ``` -------------------------------- ### Instantiating and Rendering LKPaymentWidget (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/View/Components/LKPaymentWidget.md Demonstrates a complete example of using the `LKPaymentWidget` component. It shows how to import the class, create a new instance specifying the client ID and sum, and then call the `render` method to obtain the view object, which can be used in a Blade template. ```php use App\View\Components\LKPaymentWidget;\n\n// Create a payment widget for client with ID 1 and amount 1500\n$paymentWidget = new LKPaymentWidget(1, 1500);\n\n// Render the component view\n$view = $paymentWidget->render(); ``` -------------------------------- ### Example Create Payment Request - JSON Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PaymentsController.md An example illustrating the JSON request body structure required when creating a new payment via a POST request. It includes common fields like payment date, type, amount, account, and comment. ```json { "pay_at": "2023-10-01", "type_id": 1, "amount": 1000, "account_id": 1, "comment": "Payment for service" } ``` -------------------------------- ### Initializing ContractPaymentWidget Component - PHP Source: https://github.com/sxquer/wheelai/blob/main/app/View/Components/ContractPaymentWidget.md This PHP snippet demonstrates how to create a new instance of the ContractPaymentWidget class, initializing it with a specific contract ID and a default payment sum. It shows the basic constructor call with example parameters. ```php $widget = new ContractPaymentWidget(1, 1000); ``` -------------------------------- ### Example Usage of MonthsPagination PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Helpers/MonthsPagination.md Demonstrates how to create an instance of the `MonthsPagination` class and then use its methods (`isPrevious`, `previousMonth`, `previousYear`, `nextMonth`, `nextYear`) to check for and retrieve the previous and next months and their respective years. ```PHP $pagination = new MonthsPagination(2020, 2023, 3); if ($pagination->isPrevious()) { echo "Previous Month: " . $pagination->previousMonth() . " " . $pagination->previousYear(); } echo "Next Month: " . $pagination->nextMonth() . " " . $pagination->nextYear(); ``` -------------------------------- ### Example PlanFact Income Operation Request Body (JSON) Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PlanFact/PaymentController.md An example JSON payload illustrating the structure and data required to send an income operation to the `sendPlanFactIncomeOperation` endpoint. It includes various IDs (contract, payment, account, contragent, category, project) and payment details (date, amount, type, method, client name). ```json { "contract_id": "123", "payment_id": "456", "payment_date": "2023-01-01", "account_id": "789", "contragent_id": "101112", "operation_category_id": "131415", "project_id": "161718", "amount": "1000", "type": "Оплата", "payment_method": "Карта", "client_name": "Иванов Иван" } ``` -------------------------------- ### Instantiating LeadMigrationRule Class (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/LeadMigrationRule/LeadMigrationRule.md This snippet demonstrates how to import the `App\Domain\LeadMigrationRule\LeadMigrationRule` class and create a new instance of the base class. This shows the basic usage pattern for the `LeadMigrationRule`. ```php use App\Domain\LeadMigrationRule\LeadMigrationRule; $leadMigrationRule = new LeadMigrationRule(); ``` -------------------------------- ### Accessing Admin Users (Private Method Example) - PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Helpers/ReportHelper.md This snippet provides an example of how a private method like `ReportHelper::toAdmin()` might be used *internally* to get a list of admin users. The comment indicates this direct usage is not recommended in typical scenarios. ```php // Example usage of private methods (not recommended in practice) $adminUsers = ReportHelper::toAdmin(); ``` -------------------------------- ### Initializing and Rendering SalesConvComponent PHP Source: https://github.com/sxquer/wheelai/blob/main/app/View/Components/SalesConvComponent.md This snippet demonstrates the basic usage of the `SalesConvComponent` by creating a new instance and immediately calling its `render()` method. The `render()` method is responsible for processing data and returning the final output, which is then echoed to the client. This is a typical way to use a component that generates displayable content. ```PHP $salesConvComponent = new SalesConvComponent(); echo $salesConvComponent->render(); ``` -------------------------------- ### Defining Constructor CityPlanFact PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/PlanFact/City/CityPlanFact.md This snippet shows the signature of the constructor for the CityPlanFact class. It requires start date, end date, and city objects as parameters. ```php public function __construct($start, $end, $city) ``` -------------------------------- ### Initializing Bitrix24 API Client (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Migration/MigrationManager.md Creates and returns a new static instance of the Bitrix24 API client for making requests to the Bitrix API. ```php private static function getBitrixApiClient() ``` -------------------------------- ### Example Update Payment Request - JSON Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PaymentsController.md An example demonstrating the JSON request body structure used when updating an existing payment via a PUT request. It shows typical fields that might be modified, such as type, amount, status, and comment. ```json { "type_id": 2, "amount": 1500, "status_id": 2, "comment": "Updated payment amount" } ``` -------------------------------- ### Example Usage getResultStatus PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Anketa/Models/CategoryResult.md Demonstrates how to create an instance of the CategoryResult class and call the getResultStatus method to retrieve the status. This snippet first creates an object and then prints its result status. ```php $categoryResult = new CategoryResult('completed', 'Survey Result', 5, collect(['check1', 'check2'])); echo $categoryResult->getResultStatus(); // Outputs: completed ``` -------------------------------- ### Making Batch API Calls Bitrix24 PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/BitrixCRest/CRest.md Shows how to prepare data for a batch request in the `$arData` array and use the static `callBatch` method to execute multiple Bitrix24 REST API methods (like getting a contact and a company) in a single call. ```php $arData = [ 'get_contact' => [ 'method' => 'crm.contact.get', 'params' => ['id' => 1] ], 'get_company' => [ 'method' => 'crm.company.get', 'params' => ['id' => 1] ] ]; $result = CRest::callBatch($arData); ``` -------------------------------- ### Instantiating MainContractCreated Event (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Events/MainContractCreated.md Provides an example of how to create a new instance of the `MainContractCreated` event class, passing an instance of the `Contract` model to its constructor. ```php $contract = new Contract(); // Assume this is an instance of the Contract model $event = new MainContractCreated($contract); ``` -------------------------------- ### Getting Array Representation Example PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Notifications/TestNotification.md Shows how to invoke the `toArray` method on a `TestNotification` instance. According to the current implementation, this call would result in an empty array `[]` being returned. ```php $arrayRepresentation = $notification->toArray($notifiable); ``` -------------------------------- ### Getting Telegram Message Object Example PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Notifications/TestNotification.md Demonstrates how to call the `toTelegram` method on a `TestNotification` instance. This method call returns the `TelegramFile` object configured for sending the notification. ```php $telegramMessage = $notification->toTelegram($notifiable); ``` -------------------------------- ### Instantiating SalaryBuilder Class (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Salary/SalaryBuilder.md Shows how to create a new instance of the SalaryBuilder class, passing an instance of UserPlanFactCollection to its constructor as required. This sets up the builder with the necessary data for salary calculation. ```php $userPlanFactCollection = new UserPlanFactCollection(); $salaryBuilder = new SalaryBuilder($userPlanFactCollection); ``` -------------------------------- ### OpenRouteService API Request Log Example Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/DistanceController.md This structured log entry provides an example of the data recorded when a request is made to the OpenRouteService API. It details the URL, headers (including authorization), and the JSON body payload sent to the external service for distance matrix calculation. ```JSON { "url": "https://api.openrouteservice.org/v2/matrix/driving-car", "headers": { "Authorization": "your_api_key", "Content-Type": "application/json" }, "body": { "locations": [[longitude, latitude], ...], "metrics": ["distance"], "units": "km", "sources": [0], "destinations": [1, 2, ...] } } ``` -------------------------------- ### Calling toZvonok Method Example (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Notifications/Zvonok/NeedPayemntZvonokNotification.md Provides an example of how to obtain a notifiable object and then call the toZvonok method on a previously created notification instance. This shows how to generate the Zvonok message object manually, typically for testing or specific use cases outside the standard notification sending flow. ```php $notifiable = // Получите объект получателя уведомления $message = $notification->toZvonok($notifiable); ``` -------------------------------- ### Getting Notification Channels Example PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Notifications/TestNotification.md Illustrates how to call the `via` method on an instance of the `TestNotification` class. This call would retrieve the array of configured channels, which is `["telegram"]` in this specific class. ```php $channels = $notification->via($notifiable); ``` -------------------------------- ### Rendering Tooltips Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `tooltips` method to retrieve and return the view for the Tooltips UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->tooltips(); ``` -------------------------------- ### Calling Meetings Class GroupCountByDateAndUser Method (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Indicators/Meetings.md Provides example usage of the static `Meetings::groupCountByDateAndUserAsMeetingModel` method in PHP. This method groups and counts meetings by both date and user, returning a collection of Meeting model instances. The example specifies a date period, user IDs, date format, and an indicator type constant. ```php $period = ['2023-01-01', '2023-01-31']; $user_ids = [1, 2, 3]; $indicator_type = IndicatorType::TYPE_MEETINGS_PRIMARY; $meetingsCollection = Meetings::groupCountByDateAndUserAsMeetingModel($period, $user_ids, 'Y-m-d', $indicator_type); ``` -------------------------------- ### Instantiating PHP CheckResult with Description Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Anketa/Models/CheckResult.md This PHP example demonstrates creating a `CheckResult` object with all parameters, including an optional description, and then accessing its properties using getter methods. It shows typical usage when a check is successful and provides details. ```php $result = new CheckResult("success", 5, "Check Completed", "The check was successful without any issues."); echo $result->getResultStatus(); // Output: success echo $result->getStars(); // Output: 5 echo $result->getTitle(); // Output: Check Completed echo $result->getDescription(); // Output: The check was successful without any issues. ``` -------------------------------- ### Getting CRM Contact Bitrix24 PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/BitrixCRest/CRest.md Provides a specific example of using the static `call` method to retrieve details for a CRM contact with a given ID (1) using the `crm.contact.get` method. ```php $result = CRest::call('crm.contact.get', ['id' => 1]); ``` -------------------------------- ### Rendering Progress Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `progress` method to retrieve and return the view for the Progress UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->progress(); ``` -------------------------------- ### Get Active AmoCRM User IDs PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Helpers/UserHelper.md Demonstrates how to call the `getActiveAmoUsersIdsIn` static method to retrieve an array of user IDs who have been active in AmoCRM within the specified time limit (30 minutes in this example). ```php $activeUserIds = UserHelper::getActiveAmoUsersIdsIn(30); print_r($activeUserIds); ``` -------------------------------- ### Initializing GoogleDriveMigrationService (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Services/GoogleDriveMigrationService.md This snippet shows how to create an instance of the `GoogleDriveMigrationService`. The constructor requires a `contractId` as a mandatory parameter to specify the context for the migration. An optional disk name can also be provided. ```php $contractId = 123; // Example contract ID $googleDriveService = new GoogleDriveMigrationService($contractId); ``` -------------------------------- ### Instantiating CreatePayment Event in PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Events/CreatePayment.md Provides an example of how to create a new instance of the `CreatePayment` event class by calling its constructor with specific values for lead ID, payment ID, amount, and type ID. ```PHP $event = new CreatePayment(123, 456, 99.99, 1); ``` -------------------------------- ### Execute Limit Request and Get Response (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Sms/Requests/LimitRequest.md This example shows how to call the `execute` method on an existing instance of the `LimitRequest` class. The return value of the `execute` method, representing the result or response of the request, is then stored in the `$response` variable. ```php $response = $limitRequest->execute(); ``` -------------------------------- ### Creating DebetoryDynamic Instance (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/DebetoryDymanic/DebetoryDynamic.md Demonstrates how to create a new instance of the `DebetoryDynamic` class using the `new` keyword and its fully qualified namespace. ```php $debetoryDynamic = new \App\Domain\DebetoryDymanic\DebetoryDynamic(); ``` -------------------------------- ### Example WABAMessage JSON Output Source: https://github.com/sxquer/wheelai/blob/main/app/NotificationChannels/WABA/WABAMessage.md Provides a sample of the expected JSON structure produced when a WABAMessage object is serialized. It shows the key-value pairs for the 'to', 'text', 'client_id', and 'contract_id' properties. ```json { "to": "recipient@example.com", "text": "Hello, this is a test message!", "client_id": "client123", "contract_id": "contract456" } ``` -------------------------------- ### Requesting Distance Calculation HTTP POST Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/DistanceController.md This HTTP POST request example shows how to send data to the API endpoint to calculate distances from a specific place to offices. The request body must be JSON and include the 'place_id' of the starting location. ```HTTP POST /api/get-distances Content-Type: application/json { "place_id": 1 } ``` -------------------------------- ### Loading Bitrix Leads to Database (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Migration/MigrationManager.md Fetches lead data from Bitrix24 and persists it into the local database for migration or processing purposes. Requires no parameters. ```php public static function loadLeadsFromBitrixToDatabase() ``` ```php MigrationManager::loadLeadsFromBitrixToDatabase(); ``` -------------------------------- ### Executing Artisan Command (Bash) Source: https://github.com/sxquer/wheelai/blob/main/app/Console/Commands/AddMeetingToAmo.md This Bash snippet provides a practical example of how to run the `add:meeting:to:amo` Artisan command. Executing this line in the terminal will start the process of checking for recent meetings and adding them to AmoCRM if they haven't been already. ```bash php artisan add:meeting:to:amo ``` -------------------------------- ### Initializing AmoCRM Leads Service (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Console/Commands/Amo/AmoCheckHaveTask.md This line retrieves the AmoCRM API client instance and accesses the leads service. The leads service is required to fetch deal (lead) data from the AmoCRM account. ```php $leadsService = AmoAPI::getClient()->leads(); ``` -------------------------------- ### Rendering Popovers Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `popovers` method to retrieve and return the view for the Popovers UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->popovers(); ``` -------------------------------- ### Example Calling Recipients::get PHP Method Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Sms/Recipients.md Shows how to invoke the static `get` method of the `Recipients` class. It filters recipients based on provided arrays of contract statuses and cities, returning the results grouped by phone number. Requires `Recipients` class to be accessible. ```PHP $statuses = [1, 2, 3]; $cities = [10, 20]; $recipients = Recipients::get($statuses, $cities); ``` -------------------------------- ### Initiating Call to Lead using UisAPI (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Uiscom/UisAPI.md This snippet illustrates how to initiate a call to a lead using the static `callToLead()` method from the `UisAPI` class. It takes the lead's ID and an optional boolean indicating if the lead is new. ```php $result = UisAPI::callToLead(1, true); ``` -------------------------------- ### Creating Agent Customer via RestAPI (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Uiscom/RestAPI.md This example shows how to make an API request to create a new agent customer using the dynamic method call capability (__call). It defines the data payload and prints the API response. ```php $data = [ 'name' => 'New Customer', 'email' => 'customer@example.com' ]; $response = $api->create_agent_customer($data); print_r($response); ``` -------------------------------- ### Initializing Command Constructor (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Console/Commands/AddMeetingToAmo.md This PHP snippet shows the standard constructor for the `AddMeetingToAmo` console command. It calls the parent class's constructor using `parent::__construct()`, which performs the default initialization for a Laravel Artisan command instance. This setup is minimal and does not require any specific parameters. ```php public function __construct() { parent::__construct(); } ``` -------------------------------- ### Rendering Navs Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `navs` method to retrieve and return the view for the Navs UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->navs(); ``` -------------------------------- ### Rendering Toast Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `toast` method to retrieve and return the view for the Toast UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->toast(); ``` -------------------------------- ### Rendering Buttons Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `buttons` method to retrieve and return the view for the Buttons UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->buttons(); ``` -------------------------------- ### Calling getLinkToLKSite Laravel PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Models/Client.md Shows an example of calling the `getLinkToLKSite` method on a `Client` model instance. This method generates a URL pointing to the client's personal account page on the main application website. ```php $link = $client->getLinkToLKSite(); ``` -------------------------------- ### Calling generateHash Laravel PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Models/Client.md Shows an example of calling the `generateHash` method on a `Client` model instance. This method is responsible for creating a unique hash string, likely used for identification or links. ```php $hash = $client->generateHash(); ``` -------------------------------- ### Getting Array Representation MarketingSourceAnalytic PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Marketing/MarketingSourceAnalytic.md This snippet shows how to call the `toArray()` method on a `MarketingSourceAnalytic` object to get an associative array containing all the calculated analytical data. The output can then be printed or processed further. ```php $data = $analytics->toArray(); print_r($data); ``` -------------------------------- ### Rendering Alert Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `alert` method to retrieve and return the view for the Alert UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->alert(); ``` -------------------------------- ### Loading Bitrix Deals to Database (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Migration/MigrationManager.md Fetches deal data from Bitrix24 and saves it into the local database. This method is used as part of the data migration process. Requires no parameters. ```php public static function loadDealsFromBitrixToDatabase() ``` ```php MigrationManager::loadDealsFromBitrixToDatabase(); ``` -------------------------------- ### Getting Actual Budget Spent MarketingSourceAnalytic PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Marketing/MarketingSourceAnalytic.md This snippet demonstrates calling the `getBudgetFact()` method on an initialized `MarketingSourceAnalytic` object to retrieve the calculated actual budget spent for the analyzed period and source. ```php $budget = $analytics->getBudgetFact(); echo $budget; ``` -------------------------------- ### Retrieving Payments List - HTTP GET Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PaymentsController.md Describes the HTTP GET request to fetch a list of payments. This endpoint `/payments/list` retrieves payment data, filtered or structured based on user roles or application logic. ```http GET /payments/list ``` -------------------------------- ### Rendering Media Objects Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `media_objects` method to retrieve and return the view for the Media Objects UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->media_objects(); ``` -------------------------------- ### Getting Total Contracts Sum MarketingSourceAnalytic PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Marketing/MarketingSourceAnalytic.md This snippet shows how to use the `getContractsSum()` method on a `MarketingSourceAnalytic` instance to get the total monetary sum of all contracts associated with the analyzed marketing source and period. ```php $contractsSum = $analytics->getContractsSum(); echo $contractsSum; ``` -------------------------------- ### Rendering Collapse Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `collapse` method to retrieve and return the view for the Collapse UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->collapse(); ``` -------------------------------- ### Distance Calculation JSON Response Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/DistanceController.md This JSON object shows the structure of a successful response from the distance calculation endpoint. It includes details about the starting 'place' and an array of 'offices', each with its name ('city_name') and calculated 'distance' from the starting place. ```JSON { "place": { "id": 1, "name": "London", "latitude": 51.5074, "longitude": -0.1278, "region": "England" }, "offices": [ { "city_name": "Office 1", "distance": 12.3 }, { "city_name": "Office 2", "distance": 15.7 } ] } ``` -------------------------------- ### Example Usage of passes Method for IsService Rule PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Rules/IsService.md Demonstrates how to instantiate the `IsService` rule and call its `passes` method. This example shows how to simulate validating an attribute named 'service_id' with a given `$serviceId` value. ```php $rule = new IsService(); $isValid = $rule->passes('service_id', $serviceId); ``` -------------------------------- ### Generating PKO Document - HTTP GET Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PaymentsController.md Describes the HTTP GET request used to generate a cash receipt document (PKO) for a specific payment. The endpoint `/payments/{paymentId}/generate-pko` is expected to return a downloadable document if successful. ```http GET /payments/{paymentId}/generate-pko ``` -------------------------------- ### Getting Contacts Recommended for Blacklist PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Helpers/ReanimationHelper.md Shows how to use the `getContactsToBlacklist()` method of `ReanimationHelper` to identify contacts that should be added to a blacklist based on internal criteria. This method requires an initialized `ReanimationHelper` instance and returns a collection of contacts flagged for blacklisting. ```php $blacklistedContacts = $helper->getContactsToBlacklist(); ``` -------------------------------- ### Installing Guzzle Dependency (Bash) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Uiscom/RestAPI.md This command uses Composer to add the Guzzle HTTP client library to your project. Guzzle is a required dependency for the RestAPI class to make HTTP requests to the CoMagic API. ```bash composer require guzzlehttp/guzzle ``` -------------------------------- ### Rendering Badges Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `badges` method to retrieve and return the view for the Badges UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->badges(); ``` -------------------------------- ### Displaying Edit Payment Form - HTTP GET Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PaymentsController.md Describes the HTTP GET request to retrieve and display the form populated with data for editing an existing payment. The endpoint `/payments/{paymentId}/edit` requires the ID of the payment to be edited. ```http GET /payments/{paymentId}/edit ``` -------------------------------- ### Displaying Create Payment Form - HTTP GET Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PaymentsController.md Describes the HTTP GET request to display the form used for creating a new payment linked to a particular contract. The endpoint `/contract/{contractId}/payments/create` requires the contract ID. ```http GET /contract/{contractId}/payments/create ``` -------------------------------- ### Rendering Dropdowns Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `dropdowns` method to retrieve and return the view for the Dropdowns UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->dropdowns(); ``` -------------------------------- ### Running the AmoCheckHaveTask Command (Bash) Source: https://github.com/sxquer/wheelai/blob/main/app/Console/Commands/Amo/AmoCheckHaveTask.md This snippet shows the command line syntax used to execute the `AmoCheckHaveTask` Artisan command from the terminal. Running this command initiates the process of checking deals and creating tasks. ```bash php artisan amo:check:have:task ``` -------------------------------- ### Example PHP Usage of CostRequest Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Sms/Requests/CostRequest.md Demonstrates how to instantiate the `CostRequest` class with an API key, define an array of phone numbers and the message text, and then call the public `execute` method to initiate the cost calculation process. ```php $costRequest = new CostRequest('your_api_key'); $phones = ['+12345678901', '+10987654321']; $message = 'Hello, this is a test message.'; $result = $costRequest->execute($phones, $message); ``` -------------------------------- ### Checking Server Requirements Bitrix24 PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/BitrixCRest/CRest.md Demonstrates calling the static `checkServer` method to verify if the current server environment satisfies the necessary conditions and prerequisites for the `CRest` class to function correctly. ```php $checkResult = CRest::checkServer(); ``` -------------------------------- ### Retrieving BitrixCall Records - PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Models/Bitrix/BitrixCall.md Provides examples of retrieving records using the `BitrixCall` model. It shows how to fetch all records using the static `all()` method and how to retrieve a single record by its primary key using the static `find()` method. ```php $allCalls = BitrixCall::all(); $specificCall = BitrixCall::find(1); ``` -------------------------------- ### Rendering Spinner Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `spinner` method to retrieve and return the view for the Spinner UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->spinner(); ``` -------------------------------- ### Rendering Pagination Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `pagination` method to retrieve and return the view for the Pagination UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->pagination(); ``` -------------------------------- ### Example JSON Response Structure Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Sms/Requests/CostRequest.md Provides an example of the structure and content of the JSON response that is expected from the SMS cost calculation service. It includes a list of inaccessible phones, the total calculated cost, and the total number of SMS segments. ```json { "inaccessible": [ { "phone": "+12345678901", "errorCode": "404", "errorMessage": "Not Found" } ], "totalCost": 25.50, "totalSms": 3 } ``` -------------------------------- ### Rendering Timeline Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `timeline` method to retrieve and return the view for the Timeline UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->timeline(); ``` -------------------------------- ### Importing Dependencies (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Services/GoogleDriveMigrationService.md This snippet defines the namespace and imports essential classes required by the `GoogleDriveMigrationService`. It includes models for database interaction, Google API client classes, Laravel facades for logging, storage, caching, database, and the Carbon library for date/time handling. ```php namespace App\Services; use App\Models\Contract; use App\Models\Document; use App\Models\DocumentStatus; use App\Models\DocumentType; use Google\Client; use Google\Service\Drive; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; use Carbon\Carbon; ``` -------------------------------- ### Calculating User Salaries with make Method (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Salary/SalaryBuilder.md Illustrates calling the make() method on the SalaryBuilder instance. This method processes the user plan facts provided during instantiation and performs the salary calculations, returning a collection of user salaries. ```php $userSalaryCollection = $salaryBuilder->make(); ``` -------------------------------- ### Rendering Tabs Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `tabs` method to retrieve and return the view for the Tabs UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->tabs(); ``` -------------------------------- ### Retrieving All Bitrix Deal Fields - Laravel Eloquent - PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Models/Bitrix/BitrixDealField.md This example shows how to fetch all records from the database table associated with the `BitrixDealField` model using the static `all()` method. It then loops through the collection of models, accessing and outputting the `name` and `value` attributes for each field. This method is suitable for retrieving a small number of records. ```php use App\Models\Bitrix\BitrixDealField; $dealFields = BitrixDealField::all(); foreach ($dealFields as $field) { echo $field->name . ': ' . $field->value . PHP_EOL; } ``` -------------------------------- ### Retrieving Contract Payments - HTTP GET Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/PaymentsController.md Describes the HTTP GET request used to retrieve payments associated with a specific contract. The endpoint `/contract/{contractId}/payments` requires a contract ID as a URL parameter and returns a view containing the relevant payment data. ```http GET /contract/{contractId}/payments ``` -------------------------------- ### Rendering Avatar Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `avatar` method to retrieve and return the view for the Avatar UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->avatar(); ``` -------------------------------- ### Calling Meetings Class GroupCount Method (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Indicators/Meetings.md Shows example usage of the static `Meetings::groupCount` method in PHP. This method is used to group and count meetings by date for specified users within a date range and format the date keys in the output. The example uses the 'Y-m-d' format. ```php $dates = ['2023-01-01', '2023-01-31']; $user_ids = [1, 2, 3]; $formattedMeetings = Meetings::groupCount($dates, $user_ids, 'Y-m-d'); ``` -------------------------------- ### Implementing bulkTasks Controller Method PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/Custom/Zvonok/ZvonokController.md This snippet defines the `bulkTasks` public method within the controller. It accepts an instance of `ReanimationHelper` and is intended to return a view displaying lists of reanimation and cold tasks. ```php public function bulkTasks(ReanimationHelper \$reanimationHelper) { // This will return the bulk tasks view return view('custom.zvonok.tasks.bulk', compact("reanimationTasks", "coldTasks")); } ``` -------------------------------- ### Instantiating PHP CheckResult without Description Source: https://github.com/sxquer/wheelai/blob/main/app/Domain/Anketa/Models/CheckResult.md This PHP example demonstrates creating a `CheckResult` object without providing the optional description parameter. It shows how the class handles missing optional parameters and how accessing the description would yield null. This represents a scenario where a check might fail or not require extra details. ```php $resultWithoutDesc = new CheckResult("failure", 2, "Check Failed"); echo $resultWithoutDesc->getResultStatus(); // Output: failure echo $resultWithoutDesc->getStars(); // Output: 2 echo $resultWithoutDesc->getTitle(); // Output: Check Failed echo $resultWithoutDesc->getDescription(); // Output: (null) ``` -------------------------------- ### Rendering Pills Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `pills` method to retrieve and return the view for the Pills UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->pills(); ``` -------------------------------- ### Dispatching PHP Event: PaymentReceived Example Source: https://github.com/sxquer/wheelai/blob/main/app/Events/PaymentReceived.md Provides an example demonstrating how to dispatch the `PaymentReceived` event in a Laravel application. It shows the required `use` statements, the creation and saving of a `Payment` model instance, and the dispatching of the event using the `event()` helper function, passing the saved payment object to the event constructor. ```php use App\Events\PaymentReceived; use App\Models\Payment; // Assuming $payment is an instance of Payment that has been created $payment = new Payment([...]); $payment->save(); // Dispatch the event event(new PaymentReceived($payment)); ``` -------------------------------- ### Rendering List Group Component PHP Source: https://github.com/sxquer/wheelai/blob/main/app/Http/Controllers/ComponentsController.md Demonstrates how to instantiate the ComponentsController and call the `list_group` method to retrieve and return the view for the List Group UI component. This shows a typical usage pattern within a route or another controller action. ```php $controller = new ComponentsController();\nreturn $controller->list_group(); ``` -------------------------------- ### Implementing Custom Exception Reporting Logic in Laravel (PHP) Source: https://github.com/sxquer/wheelai/blob/main/app/Exceptions/Handler.md Presents an example of implementing custom reporting logic within the `register` method using the `reportable()` callback. This specific example logs the exception message using Laravel's `\Log` facade whenever a reportable exception occurs. Developers can replace the logging logic with calls to external error tracking services or other custom actions. ```php public function register() { $this->reportable(function (Throwable $e) { \Log::error('An error occurred: '.$e->getMessage()); }); } ```