Skip to content

Instantly share code, notes, and snippets.

View hvdklauw's full-sized avatar
🏠
Working from home (mostly)

Harro van der Klauw hvdklauw

🏠
Working from home (mostly)
View GitHub Profile
@hvdklauw
hvdklauw / custom-table.blade.php
Created August 7, 2018 14:54
Custom Backpack table field that posts an actual array.
<!-- array input -->
<?php
$max = isset($field['max']) && (int) $field['max'] > 0 ? $field['max'] : -1;
$min = isset($field['min']) && (int) $field['min'] > 0 ? $field['min'] : -1;
$item_name = strtolower(isset($field['entity_singular']) && !empty($field['entity_singular']) ? $field['entity_singular'] : $field['label']);
$items = old($field['name']) ? (old($field['name'])) : (isset($field['value']) ? ($field['value']) : (isset($field['default']) ? ($field['default']) : '' ));
// make sure not matter the attribute casting