Answers for "how to save array in laravel with json function"

PHP
2

model json laravel accessor to convert to array

public function getBalanceAttribute($value)
{
    return json_decode($value);
}
Posted by: Guest on September-11-2021
0

create json laravel

$data2 = [];
foreach ($labels as $label)
{
    $data2[] = [
        'label' => $label,
        'value' => $budget->sum($label)
    ];
}
Posted by: Guest on February-03-2022

Browse Popular Code Answers by Language