public function getClassbalancesheet()
 {
     \Excel::create('Class Balance Sheet', function ($excel) {
         $excel->sheet('Sheetname', function ($sheet) {
             // first row styling and writing content
             $sheet->mergeCells('A1:W1');
             $sheet->row(1, function ($row) {
                 $row->setFontFamily('Calibri');
                 $row->setFontSize(20);
                 $row->setFontWeight('bold');
             });
             $sheet->row(1, array('Monthly Balance Sheet for Class'));
             // second row styling and writing content
             // $sheet->row(2, function ($row) {
             //     // call cell manipulation methods
             //     $row->setFontFamily('Comic Sans MS');
             //     $row->setFontSize(15);
             //     $row->setFontWeight('bold');
             // });
             // $sheet->row(2, array('Something else here'));
             // getting data to display - in my case only one record
             $users = Feedetails::get()->toArray();
             // setting column names for data - you can of course set it manually
             $sheet->appendRow(array_keys($users[0]));
             // column names
             // getting last row number (the one we already filled and setting it to bold
             $sheet->row($sheet->getHighestRow(), function ($row) {
                 $row->setFontWeight('bold');
             });
             // putting users data as next rows
             foreach ($users as $user) {
                 $sheet->appendRow($user);
             }
         });
     })->export('xls');
 }
 public function getFeeslip($id)
 {
     $admissionid = $id;
     $deposited_amount = Feedetails::find($admissionid);
     $admission_details = Admissionform::find($admissionid);
     $class = $admission_details->class;
     $examination_fees_month = date('m');
     $late_fee = date('d');
     $feedetails = DB::table('fees')->where('class', '=', $class)->first();
     return view('fees.feeslip', ['deposited_amount' => $deposited_amount, 'feedetails' => $feedetails, 'admission_details' => $admission_details, 'examination_fees_month' => $examination_fees_month, 'late_fee' => $late_fee]);
 }