### Install via Composer Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Install the Laravel Mention Me package via Composer. ```bash composer require jeffersongoncalves/laravel-mention-me ``` -------------------------------- ### Get Rewards Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Get rewards for a customer. ```php MentionMe::getRewards('customer-id'); ``` -------------------------------- ### Using MentionMe facade to get a referral Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/resources/boost/skills/laravel-mention-me-development/SKILL.md Shows how to call the MentionMe facade to retrieve a referral by ID. The method returns the decoded JSON body as an array. ```php use JeffersonGoncalves\LaravelMentionMe\Facades\MentionMe; MentionMe::getReferral('referral-id'); ``` -------------------------------- ### Get Referral Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Get a referral by its ID. ```php MentionMe::getReferral('referral-id'); ``` -------------------------------- ### Get Share Links Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Get share links for a customer. ```php MentionMe::getShareLinks('customer-id'); ``` -------------------------------- ### Adding a new endpoint to MentionMe.php Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/resources/boost/skills/laravel-mention-me-development/SKILL.md Shows the pattern for adding a new public method to src/MentionMe.php that calls the private get() helper. The method returns an array from the decoded JSON response. ```php public function newEndpoint(string $id): array { return $this->get("/new-endpoint/{$id}"); } ``` -------------------------------- ### Import Classes Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Import the MentionMe facade and exception class. ```php use JeffersonGoncalves\LaravelMentionMe\Exceptions\MentionMeException; use JeffersonGoncalves\LaravelMentionMe\Facades\MentionMe; ``` -------------------------------- ### Run Static Analysis Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Run static analysis. ```bash composer analyse ``` -------------------------------- ### Run Tests Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Run the test suite. ```bash composer test ``` -------------------------------- ### Publish Config File Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Optionally publish the package configuration file. ```bash php artisan vendor:publish --tag="mention-me-config" ``` -------------------------------- ### Create Referee Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Create a referee record for a new customer. ```php MentionMe::createReferee([ 'email' => 'john@example.com', 'firstname' => 'John', 'referrer_code' => 'REF-1', 'order_number' => 'ORD-3', 'order_total' => 42.00, ]); ``` -------------------------------- ### Config Options Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Configuration options for the package, including API key and base URL. ```php // config/mention-me.php return [ 'api_key' => env('MENTIONME_API_KEY'), 'base_url' => env('MENTIONME_BASE_URL', 'https://api.mention-me.com/api/v2'), ]; ``` -------------------------------- ### Create Referrer Offer Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Create a referrer offer for a customer. ```php MentionMe::createReferrerOffer([ 'email' => 'jane@example.com', 'firstname' => 'Jane', 'lastname' => 'Doe', 'order_number' => 'ORD-1', 'order_total' => 99.50, 'order_currency' => 'GBP', ]); ``` -------------------------------- ### Set API Key in .env Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Add the Mention Me API key to your .env file. ```env MENTIONME_API_KEY=your-api-key ``` -------------------------------- ### List Referrals Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md List all referrals for a given customer. ```php MentionMe::listReferrals('customer-id'); ``` -------------------------------- ### Run Code Formatting Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Run code formatting. ```bash composer format ``` -------------------------------- ### Handle Errors Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Handle exceptions thrown by the MentionMe API. ```php try { $result = MentionMe::getReferral('referral-id'); } catch (MentionMeException $e) { // $e->getMessage() — the API's error message, or the raw response body // $e->statusCode — the HTTP status code returned by Mention Me } ``` -------------------------------- ### Redeem Reward Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/README.md Redeem a reward for a customer. ```php MentionMe::redeemReward('customer-id', rewardId: 'reward-id', orderNumber: 'ORD-2'); ``` -------------------------------- ### Catching MentionMeException when redeeming a reward Source: https://github.com/jeffersongoncalves/laravel-mention-me/blob/main/resources/boost/skills/laravel-mention-me-development/SKILL.md Demonstrates try-catch around MentionMe::redeemReward to handle non-2xx responses. The exception carries getMessage() and a public readonly statusCode. ```php try { MentionMe::redeemReward('customer-id', 'reward-id'); } catch (\JeffersonGoncalves\LaravelMentionMe\Exceptions\MentionMeException $e) { report($e); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.