Last active
January 22, 2016 03:54
-
-
Save prio101/01a5f26da2a76be24db1 to your computer and use it in GitHub Desktop.
Please check this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Maatwebsite\Excel\Excel; | |
| use Carbon\Carbon; | |
| use App\Model\BokkingsModel; | |
| class SomeController extends Controller{ | |
| /** | |
| * Export to Excel data sheet | |
| * | |
| * @return \Maatwebsite\Excel\Excel | |
| * */ | |
| public function excel(Excel $excel){ | |
| $carbon = Carbon::now(); | |
| $doc = $excel->create('Bookings-Excel-Sheet'.$carbon , function($excel){ | |
| $excel->sheet('Bookings-excel-sheet' , function($sheet){ | |
| $bookings = BookingsModel::all(); | |
| $sheet->loadView('admin/bookings/partials/bookings-part',['bookings' => $bookings ]); | |
| }); | |
| }); | |
| return $doc; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment