Download the PHP package smk/smk_excel without Composer
On this page you can find all versions of the php package smk/smk_excel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download smk/smk_excel
More information about smk/smk_excel
Files in smk/smk_excel
Download smk/smk_excel
More information about smk/smk_excel
Files in smk/smk_excel
Vendor smk
Package smk_excel
Short Description Import Excel to database
License MIT
Homepage https://github.com/gitlky/smk_excel
Package smk_excel
Short Description Import Excel to database
License MIT
Homepage https://github.com/gitlky/smk_excel
Keywords lky_vendorsmk_excel
Please rate this library. Is it a good library?
Informations about the package smk_excel
Smk_Excel
用户导入导出Excel,要求laravel版本最低:5.1
引入方法
1.1:首先引入laravel Excel包(注意依次执行):
1.2:在config/app.php的provider数组中添加:
1.3:在config/app.php的aliases数组中添加:
1.4:执行以下命令配置你的excel:
'excel' => [ 'driver' => 'local', 'root' => public_path('excel/exports/'), ],
使用方法
一.导入
1:你需要自定义一个路由返回你需要导入的数组:
2:你需要自定义另外一个路由存入导入的数据:
注意:Excel数据是一行一行传递给你这个路由的
二.导出
你需要路由'smk_vender_excel_export_index'这个上面去,然后你还传递两个参数
1.你自定义得返回数据得路由,参数名字:route,返回得数据格式如下
$title = array(
'学号','姓名','手机号码','性别','院系','专业名称'
);
$data[] = $title;
$data[] = array(
'10011','张三','15708442244','男','计算机学院','软件技术'
);
$data[] = array(
'10012','李四','15708442245','男','计算机学院','软件技术'
);
$data1[] = $title;
$data1[] = array(
'10011','张三','15708442244','女','计算机学院','软件技术'
);
$data1[] = array(
'10012','李四','15708442245','女','计算机学院','软件技术'
);
$p ['一班'] = $data;
$p ['二班'] = $data1;
return response()->json($p);
2.参数名字more,意思是是否导出多个sheet表格。
route('smk_vender_excel_export_index',['route'=>'TestGetData','more'=>md5(1)])
上面就是传递参数的形式,more用md5转换一次
All versions of smk_excel with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0.0
anlutro/curl Version ^1.4
illuminate/support Version >=5.1
laravel/framework Version >=5.5
maatwebsite/excel Version ^3.1.26
anlutro/curl Version ^1.4
illuminate/support Version >=5.1
laravel/framework Version >=5.5
maatwebsite/excel Version ^3.1.26
The package smk/smk_excel contains the following files
Loading the files please wait ....