Inspired by classnames for react.
composer require pskordilakis/blade-directive-class
@class directive accepts a variable number of arguments that can be of type string or array and returns(prints) a class attribute for an HTML element. Any string argument will be added as part of the value of the class attribute. For the array arguments, the entries will be filtered based on the value (truthy/falsy) and the key will be added to the class value
@class('btn btn-primary')
@class([ 'btn' => true, 'btn-primary' => true, 'disabled' => $isDisabled ])
@class('btn btn-primary', [ 'disabled' => $isDisabled ])
<li @class('page-item', [ 'disabled' => $pagination->onFirstPage() ])></li>