Published on November 21, 2016
data_fill(&$target, $key, $value)
data_fill helper function accomplishes the same fundamental task as the
data_set helper function. The only difference is that the
data_fill does not define an optional
data_fill internally makes a call to the
data_set (discussed in the Laravel Miscellaneous Helper Function: data_set article) helper function with
$overwrite set to
false. This function does not overwrite data.
The following function calls are equivalent wand would produce the same results:
1<?php23// Create a object to work with.4$testObject = new stdClass;56// Set data using `data_fill`.7data_fill($testObject, 'name', 'Jane');89// Set data using `data_set`.10data_set($testObject, 'name', 'Jane', false);
Learning text parsing, manipulation, encoding and more through the Laravel string helpers.
Published on November 29, 2016
Published on April 21, 2018
Published on April 14, 2018