view = $parameters[0]; } if ($parameters instanceof \Illuminate\Contracts\View\View) { $this->view = $parameters; } $this->data = new Fluent($this->view->getData()); if (method_exists($this, 'init')) { app()->call([$this, 'init']); } $this->view->with($this->merge()); } /** * Data to be merged and passed to the view before rendering. */ protected function merge(): array { return array_merge( $this->view->getData(), $this->with() ); } /** * Data to be passed to view before rendering */ protected function with(): array { return []; } }