/app/ Просмотр/компоненты/pdf/DocumentHeader.php
Код: Выделить всё
class DocumentHeader extends Component
{
public $prefs;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct()
{
//
$this->prefs = Helper::getPreferencesAssoc();
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
return view('components.pdf.DocumentHeader');
}
}
Код: Выделить всё
@if(!empty($prefs['LOGO']))
[img]{{ $prefs[[/img]
@endif
{{$prefs['COMPANY_NAME']}}
{!! nl2br( strip_tags($prefs['INVOICE_ADDRESS']) ) !!}
@if( !empty($prefs['INVOICE_TEL']) )
Tel: {{$prefs['INVOICE_TEL']}}
@endif
Я пробовал добавление:
Код: Выделить всё
return view('components.pdf.DocumentHeader')->with([
'prefs' => Helper::getPreferencesAssoc()
]);
Подробнее здесь: https://stackoverflow.com/questions/758 ... from-class
Мобильная версия