PHP code example of payloadtoken / aragorn52

1. Go to this page and download the library: Download payloadtoken/aragorn52 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/ */

    

payloadtoken / aragorn52 example snippets


$app->register(\Payload\Providers\PassportServiceProvider::class);

class YourCustomClaimService extends \Payload\Services\AbstractClaimService
{
    public function addCustomClaims(): void
    {
        $this->claimCollection->add('test', 'testClaim');
        $this->claimCollection->add('test2', 'testClaim2');
    }
}

    public function boot()
    {
        $this->app->bind(\Payload\Services\AbstractClaimService::class, fn () => new YourCustomClaimService());
    }
bootstrap/app.php