Category : export

How to get heading from different table on export? class Kriteria_Export implements FromCollection, WithMapping, WithHeadings { public function collection() { return Alternatif::all(); } public function map($alternatif) :array { return [ $alternatif->nama_alt, ]; } public function headings(): array { return [ ‘Nama Alternatif’, ]; } } Tabel Alternatif Tabel Kriteria When Export I want like this ..

Read more

I’m using BarryvdhDomPDF export data from laravel webpage into pdf. But I’m getting ‘Maximum execution time of 60 seconds exceeded’ picture of error in app.php I already set Barryvdh class and aliases as PDF in web.php Route::get(‘/Student/Materi/singleMateri/exportPdf/{id}’, ‘[email protected]’)->middleware(‘role:Student’); in StudentController.php public function exportPdf($id) { $singleMateri = Materi::findOrFail($id); $pdf = PDF::loadview(‘pages.student.materi.exportPdf’, compact(‘singleMateri’) ); return $pdf->download(‘materi.pdf’); } ..

Read more

I have two simple files: app.js section.blade.php I’m trying to export one function to the other. app.js file: export function test(testfile) { return ‘test’; } section.blade.php <script type="module"> import { test } from ‘/js/app.js’; console.log(test); </script> When I do this, I get: Uncaught SyntaxError: The requested module ‘/js/app.js’ does not provide an export named ‘test’ ..

Read more

public function cal1(request $request){ $request->validate([ ‘month’ => ‘required’ ]); $month1 = $request->get(‘month’); // dd($month1); $date = DB::table(‘users’)->where(‘date’, ‘==’, $month1); return Excel::download(new UsersExport($date), ‘users.xlsx’); } here is my controller, it exports the excel sheet with all the data in DB table. I want to export excel sheet having data month wise. thanks in advance. Sourc..

Read more

I have a problem with exporting kml and gpx files using laravel controller: for json export I use function public function mapExportJSON(Request $request) { $client = new Client(); $http = $client->post( ‘https://myurl’ , [ ‘body’ => json_encode(array(‘points’ => $request->points)), ‘headers’ => [ ‘Cache-Control’ => ‘no-cache’, ‘Content-type’ => ‘application/json’, ] ] ); $result = $http->getBody()->getContents(); return ..

Read more

I got error when trying to export excel from my localhost This my code : `$data[‘main’] = $this->getDailyIncome($input); $data[‘data’] = $data; $data[‘payments’] = $this->payments; $dateNew = str_replace("/","-",$input->daily); $data[‘date’] = Carbon::parse($dateNew)->format(‘d-m-Y’); return Excel::create(‘Daily Report’ . $data[‘site_now’]->name, function ($excel) use ($data, $input) { $excel->sheet(‘Daily Report’, function ($sheet) use ($data, $input) { $sheet->loadView($this->viewFolder . ".excel.daily_income", $data); $sheet->setFontFamily(‘Comic Sans ..

Read more

I got error when trying to export excel from my localhost This my code : `$data[‘main’] = $this->getDailyIncome($input); $data[‘data’] = $data; $data[‘payments’] = $this->payments; $dateNew = str_replace("/","-",$input->daily); $data[‘date’] = Carbon::parse($dateNew)->format(‘d-m-Y’); return Excel::create(‘Daily Report’ . $data[‘site_now’]->name, function ($excel) use ($data, $input) { $excel->sheet(‘Daily Report’, function ($sheet) use ($data, $input) { $sheet->loadView($this->viewFolder . ".excel.daily_income", $data); $sheet->setFontFamily(‘Comic Sans ..

Read more

I’m using the Maatwebsite/Laravel-Excel 3.1 version library in Laravel to download an xlsx file. its working fine in localhost but not working in live server. UsersExport namespace AppExports; use AppExportsUsersExport; use MaatwebsiteExcelConcernsFromCollection; use DB; class UsersExport implements FromCollection { public function collection() { return DB::table(’employees’)->get(); } } Controller namespace AppHttpControllers; use IlluminateHttpRequest; use DB; use ..

Read more

I am trying to export database sql file and also save the file in database, This code working for export database file but i want to save it also in public directory //ENTER THE RELEVANT INFO BELOW $mysqlHostName = env(‘DB_HOST’); $mysqlUserName = env(‘DB_USERNAME’); $mysqlPassword = env(‘DB_PASSWORD’); $DbName = env(‘DB_DATABASE’); $backup_name = "mybackup.sql"; $tables = array("users","password_resets","divisions"); ..

Read more