<?php

// loop through array, add values to another array
$all_activities = array();
foreach($all_job_applications as $job) {
    $all_activities[] = $job;
}

// Carbon relative time
echo \Carbon\Carbon::createFromTimeStamp(strtotime($comment->created_at))->diffForHumans();

// relational where
$posts = Post::whereHas('categories', function($q)
{
    $q->where('slug', '=', Input::get('category_slug'));
})->get();

// Elequent where (1 or 2)
Model::where(function ($query) {
    $query->where('a', '=', 1)
          ->orWhere('a', '=', 2);
});