PHP Classes


Recommend this page to a friend!
  Classes of Nahid Bin Azhar  >  PHP Envato API  >  >  Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Envato API
Get users, items and forums in Envato Market
Author: By
Last change: Added Purchase Code Verify Example

Added Purchase Code Verify Example
Date: 5 years ago
Size: 2,005 bytes


Class file image Download

Envato PHP

Envato-PHP is a PHP client for Envato API. You can easily integrate it with your all kind of PHP based projects. This package is also compatible with Laravel 5.


To install this package run this command in you terminal from project root

composer require nahid/envato-php

For Laravel

Goto config/app.php and add this service provider in providers section


and add this facade in facades section

'Envato' => Nahid\EnvatoPHP\Facades\Envato::class,

Run this command in your terminal

php artisan vendor:publish --provider="Nahid\EnvatoPHP\EnvatoServiceProvider"

after publishing your config file then open config/envato.php and add your envato app credentials.

return [
    "client_id"     => 'envato_app_client_id',

    'client_secret' => 'envato_app_client_secret',

    "redirect_uri"  =>  'redirect_uri',
     'app_name'      => 'nahid-envato-app',

Thats it.


use Nahid\EnvatoPHP\Envato;

$config = [
            "client_id"     => 'envato_app_client_id',
            'client_secret' => 'envato_app_client_secret',
            "redirect_uri"  =>  'redirect_uri',
             'app_name'      => 'nahid-envato-app',
 $envato = new Envato($config);
 $user = $envato->me()->accounts();

But first you have to authenticate envato app. to get authenticate URL just use $envato->getAuthUrl().

For Laravel Usage

 use Nahid\EnvatoPHP\Facades\Envato;
 $user = Envato::me()->accounts();

 // For envato purchase code verify  
 use Nahid\EnvatoPHP\Facades\Envato;
 $purchaseCode = 'purchase_code_here';
 $purchaseVerify = Envato::me()->sale($purchaseCode);
 if($purchaseVerify->getStatusCode() == 200) {
 } else {
    dd("Invalid Purchase Code");

For more information send a message to info at phpclasses dot org.