Getting Started
Requirements
- PHP:
^8.2(including 8.3 and 8.4) - Extensions:
ext-sodiumandext-json(built into PHP) - Laravel Framework:
^11.0,^12.0, or^13.0
Installation
Install the package into your Laravel application:
bash
composer require eamirgh/torob-laravelThe package uses Laravel auto-discovery to automatically register TorobServiceProvider and the Torob facade.
Publishing Configuration
Publish the default configuration file:
bash
php artisan vendor:publish --tag="torob-config"This creates config/torob.php in your application.
Quick Setup Steps
- Configure environment variables in
.env. - Add
TorobProductContract(andHasTorobProducttrait) to yourProductmodel, and setTOROB_PRODUCT_MODEL="App\Models\Product". - (Optional) Add
TorobOrderContract(andHasTorobOrdertrait) to yourOrdermodel, and setTOROB_ORDER_MODEL="App\Models\Order". - Register the
CaptureTorobClidmiddleware in your web group to track user referrals. - Provide your endpoints to the Torob support team.