#### Category : import

I installed a module with npm: npm install –save [email protected] and it is ok. I have now last version of it. Now I need to use it and in my vue component <template> <div class="pdfviewer"></div> </template> <script> import jsPDF from ‘jspdf’; export default { name : ‘PdfTxtCreator’, } </script> So when I go with npm ..

I just doing project import excel using laravel. But there is an error when import / upload file excel and for web page can open and work. ErrorException Undefined array key 7 public function model(array $row) { return new Dso([ ‘id_dso’ =>$row[1], ‘id_rso’ => $row[2], ‘id_focus’ =>$row[3], ‘id_wilayah’ => $row[4], ‘id_grup_wilayah’ =>$row[5], ..

I finally can import excel data into database(although different code from usual imports), but it fails to attach the relationship. Three table: users(1st table), role_user(relationship table), and roles(2nd table) error: Call to a member function roles() on boolean Screenshot of the error UserImport.php use AppUser; use MaatwebsiteExcelConcernsToModel; class UserImport implements ToModel { /** * @param ..

I was posting on last discussion, may be is no clear my problem. I’m apologize if I was created 2 same discussion And now I will attach all information including all code, I hope it can be fixed soon. and there is few part SiswaController.php, use AppExportsSiswaExport; use AppImportsSiswaImport; use MaatwebsiteExcelFacadesExcel; use AppHttpControllersController; class SiswaController ..

When I’m importing data from uploaded xlsx, xls, or csv file into database from Laravel project. All extension got fails, none of them succeed in importing data into database. csv file isn’t getting any error on screen but fail store data into database, xlsx and xls is getting ‘undefined offset: 1’ result of dd($row), non .. Read more Is there a way to attach relationship in laravel directly in just one function? For example I had Three Table in Database: users(first table), user_role(relationship table), and roles(second table) In controller, AdminController.php I had this: public function import_student(Request$request) { $user = Auth::user();$this->validate($request, [ ‘file’ => ‘required|mimes:csv,xls,xlsx’ ]);$file = $request->file(‘file’);$nama_file = rand().$file->getClientOriginalName(); .. Read more I have a large number of records in an excel sheet which is taking too much time while importing to the 3 tables in database. To overcome this issue, I am trying to import it through batch by creating small excel files with less data so that I run queue jobs of laravel on it. .. Read more I have an import of employees with a unique employee number, the problem I’m facing is when 2 rows have the same number, the import still continues. This is my validation for my employee number. ‘*.employee_number’ => [‘required’, ‘max:50’, ‘unique:employee_information,employee_number,NULL,id,company_id,’.Auth::user()->company_id], Vision of the import file Employee Number| ———————| EMP1 //Accepts ———————| EMP1 //Accepts too The .. Read more I have a weird error when trying to import simple data through laravel excel. Here’s my import code: namespace AppImports; use AppContrato; use AppProvisional; use AppRecibo; use CarbonCarbon; use IlluminateDatabaseEloquentModel; use IlluminateSupportFacadesDB; use MaatwebsiteExcelConcernsToModel; use MaatwebsiteExcelConcernsWithHeadingRow; class RecibosFImport implements ToModel, WithHeadingRow { /** * @param array$row * * @return IlluminateDatabaseEloquentModel|null */ public function model(array ..

I am importing Excel File using Laravel-8 endpoints and Maatwebsite-3.1 package. The way I did it is that, the Uploaded Excel file will first get to the storage (storage/file_imports/student_imports). Then Laravel pickes it up from there, stores it into the DB table through StudentImport using Maatwebsites. StudentImport: <?php namespace AppImports; use AppModelsUser; use AppModelsStudent; use ..

Hello everyone here i am having a problem Getting Undefined offset: 1, although array $row is having the values public function model(array$row) { return new Result([ ‘roll’=>$row[0], ‘cname’=>$row[1], ‘mname’=>$row[2], ‘fname’=>$row[3], ‘dob’=>$row[4], ‘school_code’=>$row[5], ‘h1’=>$row[6], ‘h2’=>$row[7], ‘e1’=>$row[8], ‘e2’=>$row[9], ‘sanskrit’=>$row[10], ‘m1’=>$row[11], ‘m2’=>$row[12], ‘s1’=>$row[13], ‘s2’=>$row[14], ‘s3’=>$row[15], ‘sp’=>$row[16], ‘sst1’=>$row[17], ‘sst2’=>$row[18], ‘result’=>$row[19], ‘grace’=>$row[20], ]); } please help me out, i .. Read more i was importing a simple file with laravel excel and now i have to import a large file ( over 80 k row and 70 coloumn 25 Mo ) and i can t work with laravel excel what can i use ? Sourc.. Read more I import in a mysqlDB with "maatwebsite excel" an Excel file (xslx) deposited in a FTP. public function model(array$row) { //echo $this->transformDate($row[6]); //$data = Carbon::createFromFormat(‘Y-m-d H:m:s’,$row[7])->toDateTimeString(); //echo ‘carbon ‘.Carbon::now().'<br>’; //echo Carbon::parse($row[7]); return new Guida([ ‘targa’ =>$row[14], ‘driver’ => $row[10], ‘pickup_date’ => Carbon::instance(PhpOfficePhpSpreadsheetSharedDate::excelToDateTimeObject($row[7])), ‘drop_date’ => Carbon::instance(PhpOfficePhpSpreadsheetSharedDate::excelToDateTimeObject($row[8])) ]); } it works but i have .. 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 So I want to update the date using import excel laravel 8 when I import excel the second time. Database : public function up() { Schema::create(‘kunjungan’, function (Blueprint$table) { $table->bigIncrements(‘idkunjungan’);$table->string(‘number’, 255)->nullable()->unique(); $table->date(‘tanggalmulaiop’)->nullable();$table->string(‘ruangopname’, 255)->nullable(); $table->string(‘description’, 255)->nullable();$table->string(‘spesialisname’,255)->nullable(); $table->string(‘kelas’,255)->nullable();$table->timestamps(); }); } Model : protected $table = ‘kunjungan’; protected$primarykey = ‘idkunjungan’; protected $fillable .. Read more File transfer from Excel to the database is successful, but in the database all information is displayed as 0; Sourc.. Read more Im already understand to passing variable or data from controller to construct import file. but can i dynamically create import rows from my controller data? Variable in controller like$datas = AppModelsAssessmentFactor::all(); And in construct import file like $this->datas=$datas And doing loop for get the row name in process like foreach ($datas as$key => ..

I am importing an excel file in Laravel 7 that contains employees’ records. The file has Columns Employee No. and date. There are duplicate rows that contain the same employee No. and date. I want to store only 1 such record and discard the duplicate rows. Is there any way to do so? Sourc..

Sorry for the weak English. In maatwebsite excel export/import, I need to insert name instead of id. Because some fields are dynamic and fetch from other tables, so when I export it gives ids in columns, but I want the name of those entries, and when I import those entries will find the matched name ..

namespace AppImports; use AppModelsUser; use MaatwebsiteExcelConcernsToModel; use MaatwebsiteExcelConcernsWithHeadingRow; class UsersImport implements ToModel , WithHeadingRow { /** * @param array $row * * @return IlluminateDatabaseEloquentModel|null */ public function model(array$row) { return new User([ ‘name’ => $row[‘name’], ‘e_id’ =>$row[‘e_id’], ‘clockin_time’ => $row[‘clockin_time’], ‘clockout_time’ =>$row[‘clockout_time’], ‘dialinghours’ => $row[‘dialinghours’], ‘date’ =>$row[‘date’], ]); } /* public ..

i have data csv like Name | Address | City Johny| Banyurip| Surabaya i have an csv file like that. the value of city field in my db is city_id a foreign key from city table. but in csv file its writen with the city name. how to write the code in importcontroller sir ? ..

I created a package with some of my vue components which needs to be shared between several apps. In this package I wrote this line in composer.json : "autoload": { "psr-4": { "SharedAppSharedComponents": "src/components", } } in my website, where I load the package, in a vue file, I import the template like this : ..

I’m not able to modify a file. I want to import the excel file, modify it and then download it. Is there no way achieve this in version 3.1 ? Sourc..

i have some issue with my import csv in laravel with package MaatWesbite, how to i update the existing data with the import CSV ?? this is my controller : public function storeData(Request $request) {$this->validate($request, [ ‘file’ => ‘required|mimes:csv,txt’ ]); //$date = new DateTime; $exchange_rate = new ExchangeRate(); if ($request->hasFile(‘file’)) { $file = .. Read more I am having an array field status and if value 0 exists then I need to validate another field expert. public function rules(): array { return [ ‘status’ => ‘required|array|in:0,1’, ‘expert’ =>’required_if:status,==,0|array’, ]; } How can I use the withValidator.I get this error in_array() expects parameter 2 to be array, null given public function withValidator($validator) ..