laravel-excel

How can I add title and sum value of column in laravel excel version 3?

一曲冷凌霜 提交于 2019-11-29 18:44:53
I get reference from here : https://laravel-excel.maatwebsite.nl/docs/3.0/getting-started/basics So I use version 3 My controller like this : public function exportToExcel(Request $request) { $data = $request->all(); $exporter = app()->makeWith(SummaryExport::class, compact('data')); return $exporter->download('Summary.xlsx'); } My script export to excel like this : namespace App\Exports; use App\Repositories\ItemRepository; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\Exportable; use Maatwebsite\Excel\Concerns\WithHeadings; class SummaryExport implements

How can I set text align right in the column on the laravel Excel maatwebsite?

允我心安 提交于 2019-11-29 18:19:13
I get reference from here : https://laravel-excel.maatwebsite.nl/3.0/getting-started/ I have been looking for how to set the text align right, but I did not find it in the documentation My script export like this : <?php namespace App\Exports; use Maatwebsite\Excel\Concerns\Exportable; use Illuminate\Contracts\View\View; use Maatwebsite\Excel\Concerns\FromView; class InvoiceExport implements FromView { use Exportable; public function view(): View { $data = Invoice::get(); return view('exports.item', [ 'data' => $data ]); } } How can I solve this problem? Update I find a solution, but it's not

Laravel excel not exporting in correct format

时间秒杀一切 提交于 2019-11-29 18:14:28
I currently have an array that I've built that dumps like this: 0 => array:11 [▼ "category_code" => "123" "category_name" => "Testing" "category_description" => "This is a test category" 19738 => array:5 [▼ "identifier" => "720368842943" "description" => Test Description One "count" => 4 "details" => array:2 [▼ 0 => array:3 [▼ "detail_code" => "2751" "detail_code2" => "43" "detail_specifier" => "Detail One" ] 1 => array:3 [▼ "detail_code" => "2681" "detail_code2" => "9" "detail_specifier" => "Detail Two" ] ] "prices" => array:1 [▼ "01" => "1129.00" ] ] 19739 => array:5 [▼ "identifier" =>

How do I make automatic height row based on content in the maatwebsite version 3 laravel excel?

ぃ、小莉子 提交于 2019-11-29 18:09:37
I had search reference and the reference say to try like this : <?php ... class ReportExport implements ShouldAutoSize, FromView, WithColumnFormatting, WithEvents { ... public function registerEvents(): array { return [ AfterSheet::class => function(AfterSheet $event) { ... $event->sheet->getDelegate()->getRowDimension(37)->setRowHeight(-1); $event->sheet->getDelegate()->getStyle('R37:Z37')->getAlignment()->setWrapText(true); }, ]; } } I try like that, but the result like this : Should the height of row automatic added based content/text. But it does not added How can I solve this problem?

Reading excel file and uploading to database Laravel 5

谁说胖子不能爱 提交于 2019-11-28 17:12:35
问题 I have this project where I should be able to upload an excel file and read the contents then upload the information to the database. So I decided to use a library to help me out which turns to be Maatwebsite/Laravel-Excel But I tried reading the documentation http://www.maatwebsite.nl/laravel-excel/docs/import but I can't seem to find the one that I need. For example in my excel file in the first row John , Kennedy , Male which in my database corrensponds First Name , Last Name , Gender .

How can I add title and sum value of column in laravel excel version 3?

社会主义新天地 提交于 2019-11-28 13:36:56
问题 I get reference from here : https://laravel-excel.maatwebsite.nl/docs/3.0/getting-started/basics So I use version 3 My controller like this : public function exportToExcel(Request $request) { $data = $request->all(); $exporter = app()->makeWith(SummaryExport::class, compact('data')); return $exporter->download('Summary.xlsx'); } My script export to excel like this : namespace App\Exports; use App\Repositories\ItemRepository; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel