bafoed/vkapi

Laravel helper for performing requests to VK API
271 5
Install
composer require bafoed/vkapi
PHP:~5.5|~7.0
License:MIT
Last Updated:Jul 13, 2016
Links: GitHub  ·  Packagist
Maintainer: bafoed

Laravel VK API class

Install

Via Composer

$ composer require bafoed/vkapi
$ php artisan vendor:publish

After updating composer, add the service provider to the providers array in config/app.php

bafoed\VKAPI\VKAPIServiceProvider::class,

Also you can add alias to the aliases array in config/app.php

'VKAPI'     => bafoed\VKAPI\Facades\VKAPI::class,

Do not forget to change access_token in config/VKAPI.php

Usage

Simple example (access_token is loaded from config/VKAPI.php)

    try {
        $result = VKAPI::call('users.get', ['user_ids' => '1,2,3']);
        foreach ($result as $user) {
            echo $user['first_name'] . ' ' . $user['last_name'] . PHP_EOL;
        }
    } catch(\bafoed\VKAPI\VKAPIException $e) {
        echo 'Something wrong: ' . $e->message;
    }

You can change access_token at runtime using setAccessToken method

VKAPI::setAccessToken('>>> INSERT TOKEN HERE <<<')

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email bafoed@bafoed.ru instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

iwedmak/export

just some randoms stuff

13 0
bigperson/laravel-vk-geo

Parse countries, regions and cities from vk.com api

394 14
atehnix/laravel-vk-requester

Laravel package for Vk.com API

3,446 74
eggbe/laravel-soauth

Social authentication and authorization library for Laravel 5

27 1