type = $type; $this->contact = $contact; $this->currencies = $this->getCurrencies($currencies); $this->currency_code = ($contact) ? $contact->currency_code : default_currency(); $this->alias = $this->getAlias($type, $alias); $this->folder = $this->getScriptFolder($type, $folder); $this->file = $this->getScriptFile($type, $file); } /** * Get the view / contents that represent the component. * * @return \Illuminate\Contracts\View\View|string */ public function render() { return view('components.contacts.script'); } protected function getCurrencies($currencies) { if (!empty($currencies)) { return $currencies; } return Currency::enabled()->orderBy('name')->get()->makeHidden(['id', 'company_id', 'created_at', 'updated_at', 'deleted_at']); } }