예제 #1
0
 public function GradeExportLayout()
 {
     Excel::create('Grade', function ($excel) {
         $excel->sheet('Sheetname', function ($sheet) {
             $uploaddata = array();
             $ClassDetails = ClassModel::all()->toArray();
             foreach ($ClassDetails as $ClassDetailsvalue) {
                 $uploaddata[]['Grade'] = $ClassDetailsvalue['GradeName'];
             }
             $sheet->fromArray($uploaddata);
         });
     })->export('xlsx');
     return Redirect::to('class');
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $classes = ClassModel::all();
     return View::Make('app.promotion', compact('classes'));
 }