acceptedProcessInterface = Process::class; } /** * Save content page * * @param Content $page * @param array $input * * @return Content */ function run(Content & $page, array $input) { $this->runBeforeStart($page, $input); foreach ($this->processes as $process) { /** * @var $run Process */ $run = new $process; $run->handle($page, $input); } $this->runAfter($page, $input); return $page; } /** * Run process as first - if specified * * @param Content $page * @param array $input */ protected function runBeforeStart(Content $page, array $input) { if (!is_null($this->beforeStart)) { app($this->beforeStart)->handle($page, $input); } } /** * Run some process in the end - if exists * * @param Content $page * @param array $input */ protected function runAfter(Content $page, array $input) { if (!is_null($this->beforeRender)) { app($this->beforeRender)->handle($page, $input); } } }