|
Description | | Author |
This class can get users, items and forums in Envato Market.
It can send HTTP requests to the Envato Market API Web server to perform several types of operations. Currently it can:
- Get the current user details, name, email, sales, earnings, purchases, buyer download, buyer purchases, statements, bookmarks and collections
- Get other user account details, badges, items and files
- Market collections, individual items, popular items, new items, random new items, item prices, categories, features, search for items, site users, site items, items as categories
- Forum active threads, last post of user, status of thread Innovation Award
February 2017
Number 4
Prize: One downloadable e-book of choice by O'Reilly |
Envato is a well known site that is used by developers that want to sell their components.
This class can retrieve several types of interesting information about the developers and packages that they sell on Envato, like access statistics, sales, prizes, etc..
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 4x
Winner: 2x |
|
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.
Installation
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
Nahid\EnvatoPHP\EnvatoServiceProvider::class,
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.
Usages
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();
var_dump($user->data);
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();
dd($user->data);
// For envato purchase code verify
use Nahid\EnvatoPHP\Facades\Envato;
$purchaseCode = 'purchase_code_here';
$purchaseVerify = Envato::me()->sale($purchaseCode);
if($purchaseVerify->getStatusCode() == 200) {
dd($purchaseVerify->data);
} else {
dd("Invalid Purchase Code");
}