since you work with eloquent you could do the processing in your model and never worry about it. you could also provide a method to do the opposite: to save from a array of jobs to json for the database.
class Job extends Eloquent
{
/**
* will be executed as soon as you call $job->jobs
*
* @return array
public function getData()
{
$data = json_decode($this->jobs);
return $data;
}
}
this works with any property. so if you have my_pretty_long_attribute
would be public function getMyPrettyLongAttribute()
.
with your example
@foreach ($user->friends as $friends)
@foreach ($friends->jobs as $job)
$job->data // <- this will be your [1: "Software Inc", 2: "Programmer", ...] array
@endforeach
@endforeach