app/Http/Controllers/AppController.php
/**
	 *
	 * Shows enterprise and user thanks.
	 *
	 * @return Response
	 * 
	 */
Shows enterprise and user thanks.
@return Response
Shows enterprise and user thanks . @return Response
public function thanks()
    {
    	$usersThanks = DB::table('user_thanks')->join('users', 'users.id', '=', 'user_thanks.user_id')->select('receiptName AS name', 'content', DB::raw("'people' AS logo"), 'hash', DB::raw('DATE_FORMAT(thanksDateTime, "%d/%m/%Y") as date'))->where('user_id', '=', Auth::user()->id)->orderBy('thanksDateTime', 'desc')->get();
        $enterprisesThanks = DB::table('enterprise_thanks')->join('enterprises', 'enterprises.id', '=', 'enterprise_thanks.enterprise_id')->select('name', 'content', 'logo', 'hash', DB::raw('DATE_FORMAT(thanksDateTime, "%d/%m/%Y") as date'))->where('user_id', '=', Auth::user()->id)->orderBy('thanksDateTime', 'desc')->get();
        $allThanks = $usersThanks->merge($enterprisesThanks);
        $data = array(
            'enterprisesThanks' => $enterprisesThanks,
            'usersThanks' => $usersThanks        
        );
		return view('app.index')->with('data', $data);
    }
public function thanks ( ) { $ usersThanks = DB :: table ( 'user_thanks' ) -> join ( 'users' , 'users.id' , '=' , 'user_thanks.user_id' ) -> select ( 'receiptName AS name' , 'content' , DB :: raw ( " 'people' AS logo " ) , 'hash' , DB :: raw ( 'DATE_FORMAT(thanksDateTime, "%d/%m/%Y") as date' ) ) -> where ( 'user_id' , '=' , Auth :: user ( ) -> id ) -> orderBy ( 'thanksDateTime' , 'desc' ) -> get ( ) ; $ enterprisesThanks = DB :: table ( 'enterprise_thanks' ) -> join ( 'enterprises' , 'enterprises.id' , '=' , 'enterprise_thanks.enterprise_id' ) -> select ( 'name' , 'content' , 'logo' , 'hash' , DB :: raw ( 'DATE_FORMAT(thanksDateTime, "%d/%m/%Y") as date' ) ) -> where ( 'user_id' , '=' , Auth :: user ( ) -> id ) -> orderBy ( 'thanksDateTime' , 'desc' ) -> get ( ) ; $ allThanks = $ usersThanks -> merge ( $ enterprisesThanks ) ; $ data = array ( 'enterprisesThanks' => $ enterprisesThanks , 'usersThanks' => $ usersThanks ) ; return view ( 'app.index' ) -> with ( 'data' , $ data ) ; }
Shows enterprise and user thanks.
Shows enterprise and user thanks .