PHP code example of telkins / laravel-pending-action
1. Go to this page and download the library: Download telkins/laravel-pending-action 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/ */
php
use Telkins\LaravelPendingAction\Action;
class CreateSubscriber extends Action
{
public function execute(CreateSubscriberPendingAction $pendingAction)
{
// code to perform action, using $pendingAction as needed...
}
// supporting methods, if needed...
}
php
use Telkins\LaravelPendingAction\Action;
class CreateSubscriber extends Action
{
public static function prep(): CreateSubscriberPendingAction
{
return self::autoPrep();
}
public function execute(CreateSubscriberPendingAction $pendingAction)
{
// code to perform action, using $pendingAction as needed...
}
// supporting methods, if needed...
}
php
use App\EmailList;
use Telkins\LaravelPendingAction\PendingAction;
class CreateSubscriberPendingAction extends PendingAction
{
public string $email;
public EmailList $list;
public array $attributes = [];
public bool $skipConfirmation = false;
public bool $sendWelcomeMail = true;
public function withEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function forList(EmailList $list): self
{
$this->list = $list;
return $this;
}
public function withAttributes(array $attributes): self
{
$this->attributes = $attributes;
return $this;
}
public function skipConfirmation(): self
{
$this->skipConfirmation = true;
return $this;
}
public function doNotSendWelcomeMail(): self
{
$this->sendWelcomeMail = false;
return $this;
}
}
php
class UpdateLeaderboardPendingAction extends PendingAction
{
public Leaderboard $leaderboard;
public function __construct(Leaderboard $leaderboard)
{
$this->leaderboard = $leaderboard;
}
// ...
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.