I've been using Laravel some time ago, in the versions 5.x. Now I am starting new project and offcourse with latest Laravel.
I have some uncertainties about using "new" blade components. For instance I am not sure when(and how) are dynamic parts passed as component attribute, and when as a slot for instance.
Right now I am structuring single template where I will pass page title as parameter on every page using that layout component. Another part is form element which will differ, and some certaing css classes on certain div that may be optional.
Page title in header offcourse
<title>{{ $title }} </title>
<div class"main-class {{ $optionalClasses }}"></dv>
and form elements
<form>
...
{{ $slot }}
</form>
And I think usage would go like this:
<example-layout title="Some title" optional-classes="some-class">
// form elements here
</>
Am I doing this right? Also when am I suppose to use slots, and when dynamic attributes like this? What is another confusion for me is that syntax with attributes :attribute="$attribute"