Category : excel

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], ..

Read more

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 ..

Read more

I’m trying to create product upload using excel file using maatwebsite in laravel I have written This code for data import if($request->hasFile(‘file’)) { Excel::import(new FoodImport, request()->file(‘file’)); } I also define use AppModelsFoodImport; use Excel; still it gives me error Class ‘AppModelsFoodImport’ not found Can anyone help what I’m missing !? Is there anything i need ..

Read more

I’m using Laravel 8 and I have uploaded Excel file into the server. The name of the file is "data.xlsx" and it’s stored in /public/uploads. Inside the data.xlsx there are three columns with data. In my database I have already created a table called "promos". Inside that table there are three columns: id, name, code. ..

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

after download user data the create at and update at aren’t show correctly in csv file is that from excel its self or from coding get all user funcion public static function GetAllUser(){ $result =DB::table(‘users’) ->select(‘name’, ’email’, ‘phone’, ‘membership_type’, ‘membership_status’, ‘last_activation_date’, ‘membership_end_date’, ‘future_id’, ‘temporary_id’, ‘tc_no_pasaport_no’, ‘place_of_birth’, ‘date_of_birth’, ‘educational_status’, ‘school_department’, ‘Institution_and_unit’, ‘address’, ‘referance_email’, ‘letter_of_Intent’,’created_at’,’updated_at’) ->get()->toArray(); return ..

Read more

I am using maatwebsite package in my laravel 8 project to download data form database as csv but i got this error when i call the downlood function from Excel from this link enter link description here Call to undefined method MaatwebsiteExcelExcel::downlood() the User Controller <?php namespace AppHttpControllersBackend; use AppHttpControllersController; use IlluminateHttpRequest; use Auth; use ..

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 ..

Read more

I’m trying to import data from excel file to database using laravel and maatwebsite excel package So I’m using the following code : class ProjectsImport implements ToModel,WithHeadingRow,WithValidation { use Importable; /** * @param array $row * * @return IlluminateDatabaseEloquentModel|null */ public function rules(): array { return [ ‘nom’ => ‘required’, ‘prenom’ => ‘required’, ‘cine’ => ..

Read more

I’m trying to import data from excel file to database using maatwebsite excel package, I’m using the following code : namespace AppImports; use MaatwebsiteExcelFacadesExcel; use PhpOfficePhpSpreadsheetSpreadsheetSharedDate; use AppModelsCasting; use CarbonCarbon; use IlluminateSupportFacadesHash; use MaatwebsiteExcelConcernsToModel; use MaatwebsiteExcelConcernsToCollection; use IlluminateValidationRule; use MaatwebsiteExcelConcernsWithValidation; use MaatwebsiteExcelConcernsImportable; use MaatwebsiteExcelConcernsWithHeadingRow; use Auth; class ProjectsImport implements ToModel,WithHeadingRow,WithValidation { use Importable; /** * ..

Read more

I am working with Laravel 5.8 with PHP version of 7.4 to develop my project, and in this project, I wanted to make an Excel file out of a table called students. So here is what I did: I typed composer require maatwebsite/excel at the Terminal and downloaded the package. I added MaatwebsiteExcelExcelServiceProvider::class, in providers ..

Read more

I am trying to export/import excel file from/to database. For that I have viewed few tutorials. All shown same way for it. Here are the lnks. https://www.laravelcode.com/post/laravel-8-excel-and-csv-import-export-to-database-using-maatwebsite-excel-with-example https://www.itsolutionstuff.com/post/laravel-8-import-export-excel-and-csv-file-tutorialexample.html And some other. Exporting of excel from database is working fine. I am getting error only while importing. In both tutorial they shown same way of importing ..

Read more