- 2019年10月11日14:08:35 以下页面为您提供了一些使用广泛的PhpSpreadsheet食谱。请注意,这些文件没有提供有关特定PhpSpreadsheet API函数的完整文档,而只是一个.
- Laravel Excel is intended at being Laravel-flavoured PhpSpreadsheet: a simple, but an elegant wrapper around PhpSpreadsheet to simplify the exports and imports. PhpSpreadsheet is the library written in pure PHP and providing the set of classes that allow us to read from and to write to a different types of spreadsheet file formats, like Excel.
- Laravel PhpSpreadsheet. Laravel Excel features: Easily export collections to Excel, Export queries with automatic chunking for better performance, Queue exports for better performance, Easily export Blade views to Excel.
- Phpspreadsheet Get Cell Value
- Phpspreadsheet Date Format
- Phpspreadsheet Cell Split String
- Phpspreadsheet Demo
- Phpspreadsheet Library
create_worksheets.php
PHPSpreadsheet is an open-source library that includes a set of classes to allow you to interact with and utilize various spreadsheet file formats of Microsoft Excel and LibreOffice Calc. PHPSpreadsheet supports spreadsheets which contain one or more worksheets, containing cells to hold data of various types, such as, numbers, formula, image, etc. I am working on project where I need to read an excel file sent in a form and then extract data from it. I am trying to use Phpspreadsheet library for the purpose but Phpspreadsheet library does not seems to recognize the file and throws an error: The file does not exist.
<?php |
/* |
Install: composer require phpoffice/phpspreadsheet:dev-develop |
Github: https://github.com/PHPOffice/PhpSpreadsheet/ |
Document: https://phpspreadsheet.readthedocs.io/ |
*/ |
require'vendor/autoload.php'; |
usePhpOfficePhpSpreadsheetIOFactory; |
usePhpOfficePhpSpreadsheetSpreadsheet; |
// Create new Spreadsheet object |
$spreadsheet = newSpreadsheet(); |
// Set document properties |
$spreadsheet->getProperties()->setCreator('PhpOffice') |
->setLastModifiedBy('PhpOffice') |
->setTitle('Office 2007 XLSX Test Document') |
->setSubject('Office 2007 XLSX Test Document') |
->setDescription('PhpOffice') |
->setKeywords('PhpOffice') |
->setCategory('PhpOffice'); |
// Add some data |
$spreadsheet->setActiveSheetIndex(0) |
->setCellValue('A1', 'Hello'); |
// Rename worksheet |
$spreadsheet->getActiveSheet()->setTitle('URL Added'); |
$spreadsheet->createSheet(); |
// Add some data |
$spreadsheet->setActiveSheetIndex(1) |
->setCellValue('A1', 'world!'); |
// Rename worksheet |
$spreadsheet->getActiveSheet()->setTitle('URL Removed'); |
// Set active sheet index to the first sheet, so Excel opens this as the first sheet |
$spreadsheet->setActiveSheetIndex(0); |
// Redirect output to a client’s web browser (Xlsx) |
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); |
header('Content-Disposition: attachment;filename='01simple.xlsx'); |
header('Cache-Control: max-age=0'); |
// If you're serving to IE 9, then the following may be needed |
header('Cache-Control: max-age=1'); |
// If you're serving to IE over SSL, then the following may be needed |
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified |
header('Cache-Control: cache, must-revalidate'); // HTTP/1.1 |
header('Pragma: public'); // HTTP/1.0 |
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx'); |
$writer->save('php://output'); |
exit; |
commented Dec 2, 2017
commented Jan 2, 2020
you have used php spreadsheet right? can i know how to create a new worksheet in a existing excel file ? |
commented Jan 2, 2020
@asha15 I think you need to read your file first and then use method above to update to update it, then save. |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
In this article we present some popular open source projects that use Laravel. These include everything from personal music streaming servers to rapid API generator tools. In addition, we’ll see a nice collection of content management systems, forums, and even social bookmarking style applications in this roundup. Below you will find a short description and links to projects like Koel, CachetHQ, Flarum, October CMS, Laravel Voyager, Laravel Spreadsheet, MonicaHQ, Invoice Ninja, Laravel Boilerplate, Pyrocms, Polrproject, Laravel Generator, Pigjian, Vuedo, Laravel Charts, Laravel IO, Lavalite, Laravel Zero, Voten, Council, Canvas, Bookstackapp, and Apiato.
Phpspreadsheet Get Cell Value
Koel is a web based personal audio streaming application which uses VueJS on the client side and Laravel on the server side. Built by web developers for web developers, Koel makes use of many modern web technologies such as Flexbox, Vue, Laravel, and drag-and-drop API. Check out the documentation for more as well as the github repository.
CachetHQ is an open source status page system for everyone. Some of the features of Cachet include a sweet design utilizing Bootstrap, a fully integrated translation system, a nice JSON API, scheduled maintenance tools, visual metrics, and two factor authentication. Find it on github here.
Flarum is a nice build of software for forum discussions. It has a Two-Pane Interface, Infinite Scrolling, Floating Composer. Touch Optimization, Smooth Animations, Swipe Gestures, and is very fast and lightweight. Get it from github.
October CMS is a Free, open-source, self-hosted CMS platform based on the Laravel PHP Framework. It’s branded as simple, modern, universal, extendable, fun to use, reliable, and easy to learn.
It’s repository is also on github.
Need an administrative interface for your Laravel application? Then you need to check out Voyager, the missing Laravel Admin. Voyager is a Laravel Admin Package that includes BREAD(CRUD) operations, a media manager, menu builder, and much more. Github Repository.
Ready to use JSON Web Token Authentication for Laravel & Lumen – get it from Github.
Laravel Excel features: Easily export collections to Excel, Export queries with automatic chunking for better performance, Queue exports for better performance, Easily export Blade views to Excel. Github link.
You can’t remember all the things you need to remember. Monica helps you remember.
Github repo.
Invoice Ninja Features: Create Invoices in Real-Time, Create Tasks, Projects, & Track Time, Customize Invoices with Your Logo, 40+ Payment Options Supported, Accept Deposits & Partial Payments, Create Recurring & Auto-Bill Invoices, Build Trust with a Custom URL Link, and much more.
Get it on github.
All the crap you hate doing, already done. Programmed by developers, for developers.On Github.
Build better Laravel websites and applications faster with Pyro, a powerful CMS and Integrated Platform.
Github repo.
Attendize is a free & open-source ticket selling and event management platform. Github repo.
Polr is a quick, modern, and open-source link shortener. It allows you to host your own URL shortener, to brand your URLs, and to gain control over your data. Found on Github.
Laravel Generator – Get your APIs and Admin Panel ready in minutes. Laravel Generator to generate CRUD, APIs, Test Cases and Swagger Documentation. Github repo.
PJ Blog is an open source blog built with Laravel and Vue.js. Github repo.
Vuedo is a blog platform, built with Laravel and Vue.js. Daggerwin fs 18. Get it on github.
Lil uzi vert art style.
Super powerful charting using Laravel and associated charting software. On Github.
Super powerful charting using Laravel and associated charting software. On Github.
The code that powers the popular Laravel IO community forum. Github repo.
Phpspreadsheet Date Format
Lavalite is a CMS that has a standardized collection of tools and packages that are used to build and maintain a sustainable web presence. Github repo.
Micro-framework for console/command-line applications, Simple and lightweight, Built on top of the Laravel components. Github code.
Phpspreadsheet Cell Split String
Like Reddit, but better. Github Repo.
Phpspreadsheet Demo
This is an open source forum that was built and maintained at Laracasts.com. Crusader kings 3 playstation. Github repo.
Simple, Powerful Blog Publishing Platform built with Laravel. Github repo.
Simple & Free Wiki Software – BookStack is a simple, self-hosted, easy-to-use platform for organising and storing information. Github repository.
An open source framework for building scalable and testable API-Centric Apps with PHP on top of the latest stable version of Laravel. Available on Github.
Popular Applications and Websites Built With Laravel Summary
Phpspreadsheet Library
Hopefully you enjoyed this collection of apps, sites, and content management systems built with the popular Laravel framework. Perhaps you may find one of these repositories useful as a starter for your own project or simply as inspiration for your next Laravel based project.