Category : laravel-excel

Local Environment: PHP: v8.0.2 Framework: Laravel v8.* mPDF Version: v8.0.10 Deploying With: Laravel Deployer / PHP deployer (deployer) Operating System and Version: macOs Cataline 10.15.5 & Laravel Valet Production Environment: PHP: v8.0.2 Framework: Laravel v8.* mPDF Version: v8.0.10 Product version: Plesk Obsidian 18.0.32. OS version: CentOS 7.9.2009 x86_64 Description It works very well in the ..

Read more

I am using Maatwebsite Laravel-excel version 3.1. And I want to set the default styling of the sheet. I have read the documentation about including a macro in your laravel app by setting: Sheet::macro(‘getDefaultStyle’,function(Sheet $sheet){ $sheet->getDefaultStyle(); }); This in my AppServiceProvider boot() method. But when everytime i reload the page it crashes the page and ..

Read more

I have an API created for export records in xlsx. It is working fine when I call the API directly but if I am using Guzzle/Http to call the API and this was tested using Postman, I get the following error: "message": "Malformed UTF-8 characters, possibly incorrectly encoded", "exception": "InvalidArgumentException", "file": "C:xampphtdocsborneoshop-admin-laravelvendorlaravelframeworksrcIlluminateHttpJsonResponse.php", "line": 75, …… ..

Read more

In my Laravel backend project, I’m trying to customize the excel data while exporting it. I’m adding to add row colors in that excel. Excel Sheet before customization public function add_color_to_sheet($sheet) { $sheet->cells(‘A1:E1’, function ($cells) { $cells->setBackground(‘#3490ED’); }); $sheet->cells(‘A2:E2’, function ($cells) { $cells->setBackground(‘#6D8947’); }); $sheet->cells(‘A3:E3’, function ($cells) { $cells->setBackground(‘#0DF3FE’); }); $sheet->cells(‘A8:E8’, function ($cells) { $cells->setBackground(‘#0DF3FE’); ..

Read more

controller CustomersImport enter image description here enter image description here CustomerController public function importDownload(Request $request) { $request->validate([ ‘file’ => [‘required’, new ExcelRule($request->file(‘file’))], ]); $import = new CustomersImport(); $data = Excel::import($import, request()->file(‘file’),); return back()->with(‘success’, ‘Customers Data Imported successfully.’); } CustomerImport class CustomersImport implements ToCollection, WithValidation { /** * @param array $row * * @return IlluminateDatabaseEloquentModel|null */ ..

Read more

I know a similar question has been asked but the reasons for those error does not imply in my case because I am not fetching results anywhere in code. I am getting this error No query results for model [AppUser] NULL 387 /laravel/framework/src/Illuminate/Database/Eloquent/Builder.php My Excel import code: <?php namespace AppImports; use Auth; use AppUser; use ..

Read more

I am trying to export view using laravel Excel 3.1. While the export is working, I am not being able to style it. My laravel Export looks as: <?php namespace AppExports; use IlluminateContractsViewView; use MaatwebsiteExcelConcernsFromView; use MaatwebsiteExcelConcernsWithEvents; use MaatwebsiteExcelConcernsRegistersEventListeners; use MaatwebsiteExcelEventsAfterSheet; class MatrixExcelExport implements FromView, WithEvents { use RegistersEventListeners; protected $data, $selected_data, $am_lists_only, $categories_list, $amenities_list, ..

Read more

I am using Laravel Excel to generated pdf invoice. Below code is from controller to download the pdf. I have created a Export file InvoicesExport.it is downloading but styles are not applied.Can you help me to the show the invoice with styles. public function pdfInvoice($id) { $booking = Booking::findOrFail($id); return Excel::download(new InvoicesExport($booking), ‘invoice’.time().’.pdf’); } InvoicesExport ..

Read more

I trying to export a Excel file, from a collection using laravel. The code bellow, returns me this. I need to add a 2 new rows above the start of columsn, is that possible? What Should I do? <?php namespace AppTraits; namespace AppExports; // use IlluminateSupportCollection; use IlluminateDatabaseEloquentCollection; use MaatwebsiteExcelConcernsFromCollection; use MaatwebsiteExcelConcernsWithHeadings; use MaatwebsiteExcelConcernsWithMapping; use ..

Read more

When I try to export datas as excel file on the specific request I got below error PhpOfficePhpSpreadsheetReaderException Failed to load path_to_projectstorageframeworklaravel-excellaravel-excel-pz23rYwVENIOZUw7vnvhKaNjUkkNLNT8.html as a DOM Document I search alot but couldnot find any answer, the problem comes only when semester = First Sem but when semester is second, third etc this error doesn’t come and ..

Read more

[validating another 989 rows][1] [1]: https://i.stack.imgur.com/4ErrL.png i created import function with laravel-excel and i make a column as required. The file contains 10 rows, but after doing check in the failures it always return another 989 rows below the datas & heading.. any suggestion ? my controller public function import(Request $request) { $import = new ..

Read more

I have 2 endpoints: This one for filter data /api/v1/admin/sale-product?status=success&category=something So, after I filtered it I want to export those data as csv file by below endpoint: /api/v1/admin/sale-detail/export If my data isn’t filtered It will export all data. How can I do it? I’m using Laravel Excel Any suggestion? Please help me!!! My Controller: <?php ..

Read more

I am trying to export a csv file using laravel excel. The excel export are working fine at other end but on console commands it returns error Array and string offset access syntax with curly braces is deprecated Request all to please guide me with same. Command Code: <?php namespace AppConsoleCommands; use AppHttpControllersController; use Excel; ..

Read more