when i am trying to export it says that the Export::create is not found class:
use DB;
use Excel;
class ExportExcelController extends Controller
{
function index()
{
$customer_data=DB::table('book_details')->get();
return view('export_excel')->with('customer_data',$customer_data);
}
function excel()
{
$customer_data=DB::table('book_details')->get()->toArray();
$customer_array[]=array('ID','Book Name','Author Name','Publisher
Name','Supplier Name','Department of book','Book status','Book Stock',
“图片”);
foreach($ customer_data作为$ customer)
{
$ customer_array [] = array('ID'=> $ customer-> id,
'Book Name'=> $ customer-> book_name,
'作者姓名'=> $ customer-> book_author,
'发布者名称'=> $ customer-> book_publisher,
'供应商名称'=> $ customer-> book_supplier,
'图书部门'=> $ customer-> book_dept,
'图书状态'=> $ customer-> book_status,
'Book Stock'=> $ customer-> book_stock,
'图像'=> $ customer-> book_image
);
}
Excel::create('Book Data', function($excel) use($customer_array)
{
$excel->setTitle('Book Data');
$excel->sheet('Book Data',function($sheet)
use($customer_array)
{
$sheet->fromArray(
$customer_array,null,'A1',false,false);
});
})->download('xlsx');
}