Advertisement
kura2yamato

controller demo (2)

Jul 29th, 2019
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Controllers;
  4.  
  5. use Illuminate\Http\Request;
  6. Use Excel;
  7.  
  8. class DemoController extends Controller
  9. {
  10. public $name;
  11.     function index(){
  12.         $this->name='gunawan';
  13.         Excel::create('Contoh', function($excel) {
  14.  
  15.             $excel->sheet('hal 1', function($sheet  ) {
  16.                 //$sheet->loadView('view', array('key' => 'value'));
  17.                 $sheet->loadView('excel.exp1', array('name'=>$this->name) );
  18.             });
  19.  
  20.         })->export('xls');;
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement