This package provides an easy way to interact with the Envato API in your Laravel 10/11 applications.
composer require aticmatic/envatophp
php artisan vendor:publish --tag=envato-php-config
ENVATO_PERSONAL_TOKEN=your_actual_envato_personal_token
use AticMatic\EnvatoPHP\Facades\EnvatoPHP;
try {
$itemDetails = EnvatoPHP::getItemDetails(20787128);
} catch (\Exception $e) {
echo "Error: " . $e->getMessage();
Log::error($e);
}
(Documentation will get updated for each API method as implemented)
getItemDetails(int $itemId)
: Retrieves details about a specific Envato item. Returns an array of item data or throws an exception on error.- (Other methods will be here as we develop them)
The package throws exceptions when API requests fail. It's crucial to wrap your API calls in try-catch blocks to handle these exceptions gracefully. The exceptions will contain details about the error returned by the Envato API. It's also recommended to log the exceptions for debugging purposes.
Contributions are welcome! Please open an issue or submit a pull request.
This package is open-source software licensed under the MIT license.