Laravel - Blade Templates - Default Merged Attributes

Sometimes you may need to specify default values for attributes or merge additional values into some of the component's attributes. To accomplish this, you may use the attribute bag's merge method. This method is particularly useful for defining a set of default CSS classes that should always be applied to a component:

merge(['class' => 'alert alert-'.$type]) }}> {{ $message }}

If we assume this component is utilized like so:


The final, rendered HTML of the component will appear like the following: