stekel/laravel-blade-directives

A personal collection of Laravel blade directives.

v0.0.5 2023-03-04 19:38 UTC

This package is auto-updated.

Last update: 2024-05-04 22:22:48 UTC


README

A personal collection of Laravel blade directives.

Install

Via Composer

$ composer require stekel/laravel-blade-directives

Directives

Function Description
@inputValue($model, $attribute) Displays form input value, either from the given $model->$attribute or from the value of old($attribute)
@optionValue($model, $attribute, $default) Sets the select option to "selected", either from the given $model->$attribute or from the value of old($attribute)
@checkboxValue($model, $attribute) Sets the checkbox to "checked", either from the given $model->$attribute or from the value of old($attribute)
@checkboxValueFromArray($model, $attribute, $array) Sets the checkbox to "checked", if $array contains either $model->id or old($attribute)