PHP code example of bolivir / laravel-doctrine-sanctum

1. Go to this page and download the library: Download bolivir/laravel-doctrine-sanctum 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/ */

    

bolivir / laravel-doctrine-sanctum example snippets


class AccessToken implements IAccessToken
{
    use TAccessToken;
}

class AccessToken implements IAccessToken
{
      protected string $id;
    
      protected string $name;
    
      protected string $token;
        
      .......
      .......
}

class MyLoginService
{       
      .......
      .......
      public function login() 
      {
        ....
        ....
        $accessToken = $this->tokenRepository->createToken($user, 'tokenName');
      }
}
bash
php artisan vendor:publish --tag="config" --provider="Bolivir\LaravelDoctrineSanctum\LaravelDoctrineSanctumProvider"