It's as simple as this:
foreach ($campaigns as $campaign)
{
$campaign->name; // campaign model property
foreach ($campaign->task as $task) // $campaign->task is a collection (hasMany relation)
{
$task; // related Task model
$task->name; // with accessible all its properties
}
}
but the above will cause database query for every campaign in the foreach loop, so in your controller change:
->with('campaigns', Campaign::all());
// to this:
->with('campaigns', Campaign::with('task')->get());
with() method is responsible for eager loading - check that as it's a must. http://laravel.com/docs/eloquent#eager-loading
Then I suggest calling your relations appropriately to the relation itself, so singular for belongsTo or hasOne and plural for hasMany, belongsToMany, hasManyThrough etc.
That being said, I would call the relation of your like this:
// Campaign model
public function tasks()
{
...
}
Then of course you refer to 'tasks' in with() method instead of 'task'.