Reputation: 31
I want to create a blade directive for bootstrap model something like below
@model('modelid')
<div>Model body content</div>
@endmodel
Which should generate a complete bootstrap model in html, How to create a custom blade directive to capture the html content and process it?
Upvotes: 0
Views: 719
Reputation: 186
Im assuming you mean bootstrap 'modal' (correct me if I'm wrong)... you could try adding this to your AppServiceProvider boot() method
Blade::directive('modal', function ($modalid) {
$html = '<some html utilising $modalid>';
return $html;
});
Upvotes: 1