This is the documentation for v3. You can switch versions in the menu on the left/at the top. Check your current version with the following command: composer show spatie/laravel-html The class() helper The class method on Html is a helper to render a class attribute similar to Vue.js' :class property. It expects an array (or a Collection), and will toggle a set of classes depending on the values of the array. <div {{ html()->class(['foo', 'bar' => true, 'baz' => false]) }}> If there's just a value (non-associative), the class will always be added. Otherwise, the class—specified by the array key—will only appear in the list if the value evaluates to true (non-strict). +32 3 292 56 79 Our office is closed now, email us instead ESC Enter a search term to find results in the documentation.