/** * This is for joining users table and tickets table so that i can get the users info in ticket details page * @since 11-2-2016 * @author Saurabh Kumar <*****@*****.**> */ public function getAvaiableUsersDetails() { try { $result = Ticket::join('users', function ($join) { $join->on('tickets.user_id', '=', 'users.id'); })->select()->get(); return $result; } catch (QueryException $e) { echo $e; } }