<!-- resources/views/partials/modal.blade.php -->
<div class="modal">
<div>{{ $content }}</div>
<div class="close button etc">...</div>
</div>
<!-- in another template -->
@include('partials.modal', [
'body' => '<p>The password you have provided is not valid. Here are the rules for valid passwords: [...]</p>
<p><a href="#">...</a></p>'
])
Example 4-15. A modal as a more appropriate component with slots
<!-- resources/views/partials/modal.blade.php -->
<div class="modal">
<div>{{ $slot }}</div>
<div class="close button etc">...</div>
</div>
<!-- in another template -->
@component('partials.modal')
<p>The password you have provided is not valid. Here are the rules for valid passwords: [...]</p>
<p><a href="#">...</a></p>
@endcomponent
Example 4-17. Passing more than one slot to a component
@component('partials.modal')
@slot('title')
Password validation failure
@endslot
<p>The password you have provided is not valid. Here are the rules for valid passwords: [...]</p>
<p><a href="#">...</a></p>
@endcomponent