24 lines
395 B
PHP
24 lines
395 B
PHP
<?php
|
|
|
|
namespace App\Processes;
|
|
|
|
use Illuminate\Support\Facades\Pipeline;
|
|
|
|
abstract class BaseProcess
|
|
{
|
|
/**
|
|
* @var array<class-string>
|
|
*
|
|
*/
|
|
protected array $tasks = [];
|
|
|
|
public function run(mixed $payload): mixed
|
|
{
|
|
return Pipeline::send(
|
|
passable: $payload,
|
|
)->through(
|
|
pipes: $this->tasks,
|
|
)->thenReturn();
|
|
}
|
|
}
|