PHP code example of tlapi / lambda-portal

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

    

tlapi / lambda-portal example snippets


 declare(strict_types = 1);

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Tlapi\LambdaPortal\DispatchedOnLambda;

class LongJob implements ShouldQueue
{

    use Dispatchable;
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;
    use DispatchedOnLambda;

    /**
     * @var int
     */
    protected $foo;

    public function __construct(int $foo)
    {
        $this->foo = $foo;
    }

    public function handle(): void
    {
        $this->runOnLambda(function () {
            // do something
        });
    }

}