PHPackages                             ezavalishin/vkma - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ezavalishin/vkma

ActiveLibrary

ezavalishin/vkma
================

:package\_description

0.1.9(5y ago)0290MITPHP

Since Sep 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ezavalishin/laravel-vkma)[ Packagist](https://packagist.org/packages/ezavalishin/vkma)[ Docs](https://github.com/ezavalishin/vkma)[ RSS](/packages/ezavalishin-vkma/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (11)Versions (12)Used By (0)

VKMA
====

[](#vkma)

[![Latest Version on Packagist](https://camo.githubusercontent.com/148d5380c3d6afea5c93d1c1a187a5af1d4a4a4c74fed66302af74bf25add508/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657a6176616c697368696e2f766b6d612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ezavalishin/vkma)[![Total Downloads](https://camo.githubusercontent.com/d3176d418322371b96771d3060a12c1c0b9673d5e790c53e7d7729c9437eb095/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f657a6176616c697368696e2f766b6d612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ezavalishin/vkma)[![StyleCI](https://camo.githubusercontent.com/ec3cb7fe48c67f27bad38df843fb37f00baba15a40902ebe77f186f008541165/68747470733a2f2f7374796c6563692e696f2f7265706f732f3239323839303833382f736869656c64)](https://styleci.io/repos/292890838)

This is where your description should go. Take a look at [contributing.md](contributing.md) to see a to do list.

Installation
------------

[](#installation)

Via Composer

```
$ composer require ezavalishin/vkma
```

Publish config

```
$ php artisan vendor:publish --provider="ezavalishin\VKMA\VKMAServiceProvider"
```

Usage
-----

[](#usage)

### Authentication

[](#authentication)

Package provides auth driver `vkma`

You can put it in your `config/auth.php`

```
'guards' => [
    ...
    'vkma' => [
        'driver' => 'vkma'
    ]
],
```

Guard get or create user in your db by `vk_user_key`

Next you can use middleware `auth:vkma` and send request with header `Vk-Params` base64 encoded vk launch params

#### Example

[](#example)

Javascript

```
let instance = axios.create({
  headers: {
    common: {        // can be common or any other method
      'Vk-Params': btoa(window.location.search.substring(1))
    }
  }
})
```

Laravel

```
$user = Auth::user();
```

### Filling user from vk

[](#filling-user-from-vk)

Package provides Job `FillUser` which filling your db with data from vk

#### Prepare

[](#prepare)

You should implement `VKMAUserInterface` and use trait `VKMAUserable` also map vk fields

```
use Illuminate\Foundation\Auth\User as Authenticatable;

use ezavalishin\VKMA\Contracts\VKMAUserInterface;
use ezavalishin\VKMA\Traits\VKMAUserable;

class User extends Authenticatable implements VKMAUserInterface
{
    use VKMAUserable;

    public function vkFieldsMap(): array
    {
        return [
            //db field => vk field name

            'first_name' => 'first_name',
            'last_name' => 'last_name',
            'birth_date' => 'bdate',
            'city_id' => 'city',
            'country_id' => 'country'
        ];
    }
}
```

Now you can easily fill your user model just dispatch job

```
dispatch(new \ezavalishin\VKMA\Jobs\FillUser($user));
```

Or you can do it when user created, just add in your model:

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use ezavalishin\VKMA\Contracts\VKMAUserInterface;
use ezavalishin\VKMA\Traits\VKMAUserable;

use ezavalishin\VKMA\Jobs\FillUser;

class User extends Authenticatable implements VKMAUserInterface
{
    use VKMAUserable;

    ...

    public static function booted()
    {
        self::created(static function(self $model) {
            dispatch(new FillUser($model));
        });
    }
}
```

#### Custom parsers

[](#custom-parsers)

When job fetch field from vk you can easily change its format

Add in your model public method `parse{VkFieldName}`(camel case) and return value which will be stored in db

Example:

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use ezavalishin\VKMA\Contracts\VKMAUserInterface;
use ezavalishin\VKMA\Traits\VKMAUserable;

class User extends Authenticatable implements VKMAUserInterface
{
    use VKMAUserable;

    ...

    public function parseCountry($value)
    {
        return $value['id'];
    }

    public function parseCity($value)
    {
        return $value['id'];
    }
}
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Evgeniy Zavalishin](https://github.com/ezavalishin)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](LICENSE) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

10

Last Release

2054d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25b8883072798badea2a067931cfccbd1c2c9e5b4f8b2fa35923a813b92705eb?d=identicon)[ezavalishin](/maintainers/ezavalishin)

---

Top Contributors

[![ezavalishin](https://avatars.githubusercontent.com/u/2995902?v=4)](https://github.com/ezavalishin "ezavalishin (29 commits)")

---

Tags

laravelVKMA

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ezavalishin-vkma/health.svg)

```
[![Health](https://phpackages.com/badges/ezavalishin-vkma/health.svg)](https://phpackages.com/packages/ezavalishin-vkma)
```

###  Alternatives

[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M529](/packages/laravel-passport)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M106](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
