In this course we're going to build a Livewire CSV importer and exporter that can handle a huge
00:06
amount of records up to the millions. So let's go ahead and take a look around exactly what we're going to be building and we'll expand on this as we go to improve it, tweak it and add more features. Okay so the first thing that we're going to cover in the course is building out a very simple data table like the one that you can see here. We've currently got about 10,000 records in the database
00:29
here which we can go ahead and export so we're ready to export these. Now when we do export and import records the most important thing about this is queuing this. First of all so this can be run in the background we don't need to sit around waiting. Second of all so we can go ahead and export something and we can just close off the browser window and get a notification by email
00:52
when this is done ready to head over. So the first thing I'm going to do is show you how to export these records. We just go ahead and click start export and as you can see I have an export here from earlier but we get a status here as well of pending the record count so regardless of how many we've chosen this will go ahead and show that amount. Now it looks like this is complete
01:13
now that I've given this a refresh so I'm going to go ahead and click download and also in the background this has sent me an email to tell me that my export was ready. Now as part of this course like I said we're going to be building out this data table so we can choose just to select a few of the transactions or whichever data you're working with and go ahead and explore them as well.
01:33
Now the import process is of course very similar we can go ahead and upload and choose a file here this is the file that's just been downloaded and when we go ahead and start the import we pretty much get the same thing we just see a pending status until this is run in the background and successfully imported into our transactions table and this upsert so we have and pick a unique id
01:57
for this which happens to be the transaction id this will update any existing records won't duplicate them but you can go ahead and customize the logic behind the scenes and throughout the course we're going to make sure that both the import and the export functionality work regardless of the model type we're working with. We happen to be working with transactions here but if I
02:17
were to create or use a different data table for a different model I could just very easily integrate the import and export functionality into whatever I am working with so these will just work regardless of the type of model we're working with. Okay let's go through and build out this Livewire CSV importer and exporter that's capable of handling a huge amount of data.
22 episodes•2 hrs 18 mins•1 month ago
Overview
Let's build a powerful CSV importer and exporter with Livewire, completely from scratch.
This can handle millions of rows, be reused for multiple models, and by using queues, doesn't require the browser to be open.
This course is for you if:
You need a robust drop-in importer and exporter component for your models that you have full control over
You want to brush up on some advanced Livewire concepts