Wednesday, March 1, 2017

Laravel 5 proper way to require CSS file from view

I've got specific Form component, which is declared as

Form::component('fcRadio', 'components.form.fcradio', ['name', 'options', 'selected' => null]);

and used as



What I want is somehow attach custom CSS file, so if the page fires this component at least once, the desired CSS file is included to the <head> of my document.

For example, in Joomla it was like

$this->document->addStylesheet('my_awesome_style.css');

Is there any way to achieve the same in Laravel?




via Denis Sheremet

Advertisement