app/Http/Controllers/Tutor/PaychequesController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $myuser = Auth::User();
        $paycheques = $myuser->paycheques()->get();
        $data = Array();
        foreach($paycheques as $paycheque)
        {
            $data[date('Y-m', strtotime($paycheque->paycheque_date))] = $paycheque;
        }
        krsort($data);
        return view('tutor.paymentrecords.index') -> with('data', $data);
    }
public function index ( ) { $ myuser = Auth :: User ( ) ; $ paycheques = $ myuser -> paycheques ( ) -> get ( ) ; $ data = Array ( ) ; foreach ( $ paycheques as $ paycheque ) { $ data [ date ( 'Y-m' , strtotime ( $ paycheque -> paycheque_date ) ) ] = $ paycheque ; } krsort ( $ data ) ; return view ( 'tutor.paymentrecords.index' ) -> with ( 'data' , $ data ) ; }
Display a listing of the resource.
Display a listing of the resource .