PHP code example of vuetober / rainlab-user-api

1. Go to this page and download the library: Download vuetober/rainlab-user-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vuetober / rainlab-user-api example snippets


use Bedard\RainLabUserApi\Classes\AccountManager;

$user = AccountManager::getAuthenticatedUser();

public function boot()
{
    Event::listen('bedard.rainlabuserapi.afterGetUser', function ($user) {
        $user->load(['avatar']);
    });
}

public function boot()
{
    \Bedard\RainLabUserApi\Classes\ApiController::extend(function($controller) {
        $controller->middleware('Path\To\Custom\Middleware');
    });
}