Laravel 8 Import CSV and Choose Fields

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

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

  • @fdelval2
    @fdelval2 3 года назад +4

    Wow this morning I woke up with the idea of providing an importing tool to my company, and you just read my mind and paved my way. Thank you so much.

  • @Chim
    @Chim 3 года назад +2

    This is one thing I always wondered how to do. My general approach was to not store the data in the database temporarily, but use arrays in code to output the data... This is a much more elegant way of performing this, so much so, it'll work great on a current project I am currently working on.
    Thank you for your continued hard work and effort - It's absolutely appreciated.

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

    Another gem video from my favorite channel.
    Thanks

  • @gebruikersnaam999999
    @gebruikersnaam999999 3 года назад +9

    Cool! It would be nice to optimize this for bigger files (million rows for example) without building an array in memory. Using fgetcsv or SplFileObject with a generator

    • @ClCfe
      @ClCfe 3 года назад +1

      I use fgetcsv, yield, lazy collection then chunk to do bulk insert

  • @raimonds.L
    @raimonds.L 3 года назад +1

    Does it work with a 1GB file?

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

    I'm trying of run your project and I got this error mybd.people' doesn't exist (SQL: select count(*) as aggregate from `people`) when I'm tried to acces to / endpoint ? what could be?

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

    Hi, how would we go about applying the Import CSV function to multiple different datatables? Thanks!

  • @TechPriest27
    @TechPriest27 3 года назад +1

    I don't get why do we need whole table for some temporary data, and what if multiple people use this tool almost simultaneously?

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

      For multiple people you can put some identifier like user id in that exact table

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

    Okay, so I have a Countries, States and Cities CSV file with 4,3 million entries and the file is about 1gb. I want to divide it into countries, states and cities table, and making pivot table that will organize everything. Is this the right place to start? Or would the best idea be to hire someone who can do this for me? Or is there a way just generating a database seeder from the file?

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

    When is good idea to switch from saving many settings like JSON object in one column(I saw this for csv_data column) instead of making new table with all the column needed respectively?

    • @usanzadunje
      @usanzadunje 3 года назад +1

      Nevermind, found your video about this. ruclips.net/video/9uhXI4nDpOQ/видео.html

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

    Hello, I would like to see how to export data from database into csv file. I have status fields and etc in database as integers.
    The main problem I am facing, how to cast values for users to understand values. I can cast data in models, but how transform data only when calling csv export?

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

      with that package, you can export the data as you want like full customization before export it

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

    Thanks

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

    Hello Povilas! I have been following your channel for some time now, thank you for providing us with quality materials :).
    I got a question and I hope you can give me your opinion on this one: I started working recently for a new company and I got a project, its about making a tender platform for a client with a lot of background functionality (accounting stuff, service books etc.) This first client is in hospitality/service business. But my boss has an idea to make this platform very flexible, so that it can be used by other businesses too (next client is from leasing/transportation branch with their specific requirements). I don't see any intersecting areas between these business domains, except that they need similar platform for their tenders. How would you approach such problem? I am not sure how to even create Models for this project (my boss has an idea of "on-the-fly" Models - to be honest I never heard something like that). Thank you, your opinion would be very appreciated.

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

      I can't answer this in a short RUclips comment, sorry, would need to analyze the situation deeper.

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

      ​@@LaravelDaily I understand... Hopefully, I'll find a way out. Thank you for the reply though :)

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

    honestly I dislike the new Laravel Excel, it makes everything way more complicated than needed and lacks docs about doing more complex things, had to fall back directly to phpspreadsheet to get things done

  • @keithprinkey8575
    @keithprinkey8575 10 месяцев назад

    Does it have to be Laravel 8 for this package to work? I am using laravel 9 for my current project