app/Http/Controllers/ReportEnterpriseController.php
/**
	 * Generate a custom report
	 *
	 * @return Response
	 */
Generate a custom report
@return Response
Generate a custom report @return Response
public function generateCustomReport($type, $start, $end)
	{		
		$customReport = User::select('users.' . $type, \DB::raw("count(users.$type) as thanks"))->whereBetween('thanksDateTime', array(new Carbon($start), new Carbon($end)))->join('enterprise_thanks', 'enterprise_thanks.user_id', '=', 'users.id')->groupBy('users.' . $type)->get();
		return $customReport;
	}
public function generateCustomReport ( $ type , $ start , $ end ) { $ customReport = User :: select ( 'users.' . $ type , \ DB :: raw ( " count(users. $ type ) as thanks " ) ) -> whereBetween ( 'thanksDateTime' , array ( new Carbon ( $ start ) , new Carbon ( $ end ) ) ) -> join ( 'enterprise_thanks' , 'enterprise_thanks.user_id' , '=' , 'users.id' ) -> groupBy ( 'users.' . $ type ) -> get ( ) ; return $ customReport ; }
Generate a custom report
 @return Response
Generate a custom report @return Response
//dd($customReport);