How to Import Excel Data in Laravel and Insert into Database

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024
  • Learn How to importing data from Excel Speedsheet by using Maatwebsite package in Laravel and insert into Mysql database. How to import excel file data in Laravel using Maatwebsite package. How to import Excel file into Mysql database in Laravel framework.
    For Source Code - www.webslesson...

Комментарии • 57

  • @MukeshKumar-mw2pp
    @MukeshKumar-mw2pp 4 года назад +2

    I am using version "laravel/framework": "^6.2", Excel package is not working getting this error {message: "Call to undefined method Maatwebsite\Excel\Excel::load()",…} please help

  • @tsedenbaljirerdenetsogt3079
    @tsedenbaljirerdenetsogt3079 4 года назад

    pls help me push git :( i cant (In ProviderRepository.php line 208:
    Class 'Maatwebsite\Excel\ExcelServiceProvider' not found )

  • @hamadelmalik8424
    @hamadelmalik8424 Год назад

    Hi v good video but I need to compare vetween excel file and my database file I mean am not need to insert it in my database

  • @jaikangammalangmei8271
    @jaikangammalangmei8271 5 лет назад +11

    Call to undefined method Maatwebsite\Excel\Excel::load() error

    • @karlgarcia3039
      @karlgarcia3039 4 года назад +1

      Follow this Guide
      bishrulhaq.com/posts/import-export-excel-to-database-in-laravel
      Note: load is removed in maatwebsite 3.0, So make sure you copy paste 2.1.3 from site then run composer update.
      cheers!

    • @kingrichardguevara4969
      @kingrichardguevara4969 4 года назад

      @@karlgarcia3039 Hello, I have 2.1 maatwebsite/excel and 5.8 laravel but I still get this error

    • @karlgarcia3039
      @karlgarcia3039 4 года назад

      @@kingrichardguevara4969 follow the post. copy paste the maatwebsite in composer.json under require and run composer update in you cmd.
      Foklow the blog step 3 carefully. It should work

  • @alisheradm6527
    @alisheradm6527 5 лет назад +2

    I have a problem: Call to undefined method Maatwebsite\Excel\Excel::load()

    • @victorpinedo5121
      @victorpinedo5121 5 лет назад

      Hi, Maatwebsite/Excel package is not more include import options, that library has been change, you can solve this issue changing the package version in your composer.json file, put this: "maatwebsite/excel": "~2.1.0" in the require section on composer.json, then go to console terminal and type this: composer update !!! sorry my english please, am from Colombia, i don´t know much English!

    • @aravindharisree1902
      @aravindharisree1902 5 лет назад

      @Karthick V use "maatwebsite/excel": "2.1.30",

  • @kennyendowed9814
    @kennyendowed9814 3 года назад

    am having an error time out after 60 seconds my excel data have 10,000 records

  • @gedeonbassah2830
    @gedeonbassah2830 3 года назад

    Error
    Call to undefined method Maatwebsite\Excel\Excel::load()
    please help me

    • @alaaalssadh2362
      @alaaalssadh2362 2 года назад +1

      it is because the version of the excel package, don't use version 3, use version 2

  • @geraldterencio8635
    @geraldterencio8635 4 года назад

    Can anyone help me how to put validations in each column?

  • @brijeshmkt
    @brijeshmkt 5 лет назад +1

    laravel 5.8 in not work

  • @25-henglyhort57
    @25-henglyhort57 4 года назад

    I got error Undefined index: customer_name

  • @felipecastillo4048
    @felipecastillo4048 5 лет назад +1

    thanks, I had a lot of problems with the version 3.1, I suggest to use this instead

  • @fardeenkhan4662
    @fardeenkhan4662 5 лет назад

    Can I implement this without using laravel framework?

  • @laeh475
    @laeh475 4 года назад

    it no work

  • @lynic-0091
    @lynic-0091 4 года назад

    uwuwuevue luwuvel

  • @milkyplay6995
    @milkyplay6995 4 года назад +1

    How about automate all in one click, dynamic data in just one click

  • @SoloSprints
    @SoloSprints 5 лет назад +1

    undefine customer_name

  • @Aisha-sy3bd
    @Aisha-sy3bd 5 лет назад +1

    i faced this error " Illegal string offset 'customer_name'
    how can i solve this error please ???

    • @leandrosalles4799
      @leandrosalles4799 5 лет назад

      You don't need both foreach just one, use this code or comment your second foreach.
      I apologize for my english, I'm brazilian
      foreach($data->toArray() as $key => $value)
      {
      // foreach($value as $row) {
      $insert_data[] = array(
      'CustomerName' => $row['customer_name'],
      'Gender' => $row['gender'],
      'Address' => $row['address'],
      'City' => $row['city'],
      'PostalCode' => $row['postal_code'],
      'Country' => $row['country']
      );
      // }
      }

    • @alvaroparra8055
      @alvaroparra8055 5 лет назад

      ​@@leandrosalles4799 This procedure is correct:
      ImportExcelController.php:
      foreach($data->toArray() as $key => $value)
      {
      $insert_data[] = array(
      'CustomerName' => $value['customer_name'],
      'Gender' => $value['gender'],
      'Address' => $value['address'],
      'City' => $value['city'],
      'PostalCode' => $value['postal_code'],
      'Country' => $value['country']
      );
      }

  • @mohammed_m._ayoub
    @mohammed_m._ayoub 4 года назад +1

    what is the import_exel/import in form

  • @anggitkurniawan5312
    @anggitkurniawan5312 5 лет назад

    sir can u help me? i get errors message "Call to undefined method Illuminate\Database\Query\Builder::table()", how to fix that??

  • @nmggaming4525
    @nmggaming4525 4 года назад

    Error
    Call to undefined method Maatwebsite\Excel\Excel::create().. Any solution for this?

  • @nshaikh1111
    @nshaikh1111 2 года назад

    Can we also import excel containing Image path , if yes can you please guide me for the same. ?

  • @raulduarte1057
    @raulduarte1057 5 лет назад +1

    Illegal string offset 'customer_name'

  • @funtech2288
    @funtech2288 5 лет назад +5

    Illegal string offset 'customer_name' Sir i m facing this problem please tell me

    • @nikunjonil9530
      @nikunjonil9530 5 лет назад

      same here
      need fix

    • @Aisha-sy3bd
      @Aisha-sy3bd 5 лет назад

      how can you solve it ???

    • @leandrosalles4799
      @leandrosalles4799 5 лет назад +2

      You don't need both foreach just one, use this code or comment your second foreach.
      I apologize for my english, I'm brazilian
      foreach($data->toArray() as $key => $value)
      {
      // foreach($value as $row) {
      $insert_data[] = array(
      'CustomerName' => $row['customer_name'],
      'Gender' => $row['gender'],
      'Address' => $row['address'],
      'City' => $row['city'],
      'PostalCode' => $row['postal_code'],
      'Country' => $row['country']
      );
      // }
      }

  • @victorpinedo5121
    @victorpinedo5121 5 лет назад

    WHATEVER THIS CAN HELP: Maatwebsite/Excel package is not more include import options, that library has been change, you can solve this issue changing the package version in your composer.json file, put this: "maatwebsite/excel": "~2.1.0" in the require section on composer.json, then go to console terminal and type this: composer update !!! sorry my english please, am from Colombia, i don´t know much English!

    • @SoloSprints
      @SoloSprints 5 лет назад

      its throw error undefine customer_name

  • @leandrosalles4799
    @leandrosalles4799 5 лет назад

    You don't need both foreach just one, use this code or comment your second foreach.
    I apologize for my english, I'm brazilian
    foreach($data->toArray() as $key => $value)
    {
    // foreach($value as $row) {
    $insert_data[] = array(
    'CustomerName' => $row['customer_name'],
    'Gender' => $row['gender'],
    'Address' => $row['address'],
    'City' => $row['city'],
    'PostalCode' => $row['postal_code'],
    'Country' => $row['country']
    );
    // }
    }

    • @khenieryanti9227
      @khenieryanti9227 5 лет назад

      Why I still get erorrs after use your code? It say, 'undefined variabel:row'.
      I apologize for my english,

  • @TheUndulyNoted
    @TheUndulyNoted 3 года назад

    Really? You couldn't get a mic?

  • @becob250_tanvinimbalkar4
    @becob250_tanvinimbalkar4 2 года назад

    how do we sort the data from this whole excel data?

  • @akfirebaseakfirebase5883
    @akfirebaseakfirebase5883 5 лет назад

    this msg :simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found ?

  • @luckyadiatma2157
    @luckyadiatma2157 4 года назад

    Many thanks for this explanation, and it's work for me. But I have a question. Can we do Update instead Create? I trying to figure this out because there are 'id' in my database but the key value (like price, qty, etc) is not yet set. My goal is how to make excel file that we send to server is update the database instead insert in. Anyone with the same question?

    • @luckyadiatma2157
      @luckyadiatma2157 4 года назад

      Well, for those who have the same issue, I found the answer already.
      Here --> stackoverflow.com/questions/54304707/how-to-update-data-in-database-using-import-excel

  • @vietvietnguyen8186
    @vietvietnguyen8186 4 года назад

    how to import date data ?

  • @chanpisethchea5121
    @chanpisethchea5121 3 года назад

    Hello Sir, I got error " Call to undefined method Maatwebsite\Excel\Excel::load()". Could you please advice?

    • @vasagan100
      @vasagan100 3 года назад

      i have same issue!!! Have you fixed that??

    • @FoudNa
      @FoudNa 3 года назад

      same. and not sound from plugin owner

    • @alaaalssadh2362
      @alaaalssadh2362 2 года назад

      @@vasagan100 version of excel package, use version 2 instead of version 3

  • @vuthpich7552
    @vuthpich7552 4 года назад

    thanks you bro.

  • @ИванЧеловеков-ъ9м
    @ИванЧеловеков-ъ9м 5 лет назад

    How to import in related tables (one to many for example)?