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