Using lazycollection in the constructor by rewriting the query as User::select('id', 'name', 'email')->cursor()->remember() could save you some memory. Considering imports can be often pretty large, a good idea is to use chunk reading in laravel excel (even if you don't need it at first) to prevent scaling issues.
@wahyusetya1722 жыл бұрын
i dont find in the laravel docs about how much time this cache will be stored, since the data can be dynamic, i think this approach is not the best idea
@kirilllubynets85922 жыл бұрын
Very thanks for your video. hellow from Ukraine
@jannusdomingo56813 жыл бұрын
We've been struggled on understanding the eloquent query I mean the Joins. I had the idea of you making a tuts on what the left joins & inner joins means in Eloquent, I mean you show us the old way and then convert it in eloquent way. Btw all your tuts help us a lot! 🍻
@LaravelDaily3 жыл бұрын
Added to the to-do list, will come up with some useful angle about joins
@jannusdomingo56813 жыл бұрын
@@LaravelDaily Thank you so much my fav tutor here! We're excited! 🍻😊
@intipontt74903 жыл бұрын
joins don't work differently in eloquent. Unless you mean relationships, but those are not joins at all most of the time. You can dump the query to inspect the generated sql.
@jannusdomingo56813 жыл бұрын
@@intipontt7490 yeah but we do not know where to start on how to convert our joins in to eloquent
@LaravelDaily3 жыл бұрын
Can you email me povilas@laraveldaily.com a few examples of such joins? Then I may try to convert them in the video, would be the most practically useful for everyone. @Jannus Domingo
@diggdiganta3 жыл бұрын
Please provide an example if we need to import to multiple database tables from one CSV file.
@MarkKulishov3 жыл бұрын
Have you compared the speed of the database selects with the speed of the collection search? If there are many users, the collection search should be longer. The second question: it might be more optimal to translate the collection of users into an array, where the key is an email. Then the substitution of user IDs would occur instantly
@LaravelDaily3 жыл бұрын
Valid points, maybe it would speed up even more, haven't tried.
@andrewjackson38902 жыл бұрын
Very useful for me, thank you!!!
@roselfrancisco14632 жыл бұрын
The best tutorial as always!
@phanirajk91443 жыл бұрын
Thanks a lot. It is really helpful.
@Gosa-li1ei Жыл бұрын
Thanks so much Dear Sir.
@gurramkondabhargav83402 жыл бұрын
Great sir, At a time It will insert to Two different DB's
@jonathanoeijoeng2 жыл бұрын
Hi, your channel is helping me a lot to understand laravel better. Regarding to import from csv file, is it possible to import sheet into multiple tables? Thanks so much
@3rkan0zturk Жыл бұрын
Awesome, thank you👏
@oimso3 жыл бұрын
Nice Video, How to export two or more queries to excel?
@surflaweb3 жыл бұрын
Great example!!
@majid_alsaidi2 жыл бұрын
I have for example a user table and role table. The relation is hasMany with a pivote table between them. there is no actual column between the two tables. can we import users from csv witht the role id?
@ammarqureshi48873 жыл бұрын
Thankyoy can make how get separate array like laravel relationship with inner joins .
@pkeerthana723 Жыл бұрын
Is there any way to validate unique email when emails are stored in database as encrypted data and display error message row wise in blade file.
@devaes3 жыл бұрын
good timing ! thank you sir
@akichoe2 жыл бұрын
hi.. can i get simple import with multiple start and end date per id? example; one id have many start and end date.
@ImamAdiNata2 жыл бұрын
how about importing one excel file into 2 tables in database?
@kennethkipchumba2532 Жыл бұрын
What would be an example use case for such a feature ?
@BoiteSphinx3 жыл бұрын
Thanks for your video! How should I use a trait if i'm workng with multiple sheets. In my app i have multiple sheets, most of them have a manufacturer. Right now I use a trait that fetches the manufacturer based on its name, but everytime i switch sheet, the trait's constructor gets called, how can I limit database interractions with such layout?
@thedream8420 Жыл бұрын
Sir do you have a video of multi sheet excel import in database in different tables?
@LaravelDaily Жыл бұрын
No
@NathanBudd3 жыл бұрын
What about if the `user_id` is a non-nullable foreign key? I realise that we could do `firstOrCreate`, but how do you then update the `users` in the constructor?
@rolandosanches23443 жыл бұрын
You can add then to users collection, using prepend() or push() method
@kanzuleman49062 жыл бұрын
while i am doing the same as you are but it is giving me error that undefined index title, title is present in my role class which is actually in relation with the user class one user has one role how can i fix that?
@hamzaashraf95293 жыл бұрын
and it would be great if you add a button under your course like send offer (someone can offer you a buy price for every single course).
@aungchanoo86823 жыл бұрын
Can you show us how to import images from excel file?
@bamswisnu48232 жыл бұрын
why im running local 'error undefined index: amount' ? please help solving
@shelderrr3 жыл бұрын
What about pivot tables?
@yogeshwarbarai9686 Жыл бұрын
The file needs to be in csv is mandatory or it can also work with xlsx extension type?
@LaravelDaily Жыл бұрын
Should work with xlsx too, but try it out.
@bibhasash73712 жыл бұрын
how to configure header columns with column names having space between like fist name
@marcinrobertkazmierczak2 жыл бұрын
Hello Povilas. I'm your student :) I have bought your Laravel Excel course. What if I'm importing file for example with books, and I have some authors which are not present in database? How to add those missing authors in one import and sync them to books via pivot table :) ?
@LaravelDaily2 жыл бұрын
It's been a while since I worked with Excel import, so I don't really remember. Googled a bit, found a few resources: laracasts.com/discuss/channels/laravel/laravel-excel-import-csv-data-relationed-to-another-table github.com/SpartnerNL/Laravel-Excel/issues/1966
@fabrizziomorenor.64952 жыл бұрын
Exist a way i can read the heading row and import in every row imported. Example CARS column..import and set in a column name category...put the CARS string.??? :P
@Anonymouseab2 жыл бұрын
hi bro thanks really too it is helpful but i am getting this error bro Trying to get property 'id' of non-object
@GergelyCsermely3 жыл бұрын
Thanks
@noplay63603 жыл бұрын
Hey Povilas What are your thoughts about inertia with vue and laravel backend? I haven't seen a video about inertia on your channel. So currently I'm thinking about learning livewire, but looking at performance, idk if it's any better than intertia + vue.
@LaravelDaily3 жыл бұрын
Planning inertia content a bit later on the channel, not sure why
@zineddineabdellatif48372 жыл бұрын
greate like always
@sarojguragain5543 жыл бұрын
Sir, How to use laravel Log with slack in localhost.
@jahanzaibhussain75983 жыл бұрын
just a big wow!
@abedshamia80943 жыл бұрын
What if there were no similar column names, and the only relatable column was user_id? :/
@pondokkoding50232 жыл бұрын
how to register in your course? there is no register button in your website
@LaravelDaily2 жыл бұрын
You need to purchase that course, there's no "register" button, there's "buy" button.
@pondokkoding50232 жыл бұрын
@@LaravelDaily okey have done
@pondokkoding50232 жыл бұрын
how to import db3 file into database in laravel, Sir?
@_fajarsetianto3 жыл бұрын
How to validate that excel file for each row before saving into database?
@LaravelDaily3 жыл бұрын
I have a video about it: kzbin.info/www/bejne/pqTLp4p5eN52fdk
@Antonius772 жыл бұрын
А что если отношения Many to Many через pivot таблицу?!
@tech.business-agencedigita482011 ай бұрын
I have this error : Failed to open stream: Permission denied
@webpakistan95893 жыл бұрын
what if we need to export 500000 rows?
@PsyHooZ3 жыл бұрын
with DB already includes a tons of users... with User::all() your memory say: "OK, I'm out" ?
@Remls3 жыл бұрын
@@PsyHooZ Just download more memory, ez /j
@popelyshyn3 жыл бұрын
Chunks?!
@SeyedSadeghAtaii3 жыл бұрын
It's a good point but if you check the premium course he provides, or the documentation for laravel excel it should be all you need to know.
@konstruktion3 жыл бұрын
Can you make a video where you explain how to write a method in the test that creates (Jetstream) a user via Factory and logs in with that. At Laracasts I only got "it's so simple" answer and thus not helpful. 🙏🏻🙏🏻🙏🏻
@LaravelDaily3 жыл бұрын
$user = User::create() auth()->login($user); Or do you really need a video about it?
@konstruktion3 жыл бұрын
@@LaravelDaily $user = User::factory()->create(); auth()->login($user); $response = $this->get('/clients'); $response->assertStatus(200); Not working, because is not so simple. :(
@LaravelDaily3 жыл бұрын
Then it's something with the logic of your application and why it doesn't return 200. Maybe it returns 403 because of some permissions? Not sure, needs debugging.
@Roy-xd5mw3 жыл бұрын
How to export image in excel with other data
@LaravelDaily3 жыл бұрын
Why would you want to export images into excel? Excel is not typically used for storing images.
@Roy-xd5mw3 жыл бұрын
@@LaravelDaily if we use js script we can easy export images So, why not with laravel sir ?
@Roy-xd5mw3 жыл бұрын
Please guide or make some video in which we can easily export images with other data from table
@LaravelDaily3 жыл бұрын
Sorry I don't have any examples of images, I just personally haven't encountered excel files that would contain images, in my opinion Excel files are for calculations and data, not for images. Please read the official docs of Laravel Excel package, maybe they will have something.
@oimso3 жыл бұрын
Maybe this will help you. kzbin.info/www/bejne/jIbIpWWtppdlY9E
@hamzaashraf95293 жыл бұрын
i'm sorry but your prices are too high 29$,99$ in pakistan 99$ equals to 17,127.49 Pakistani Rupee. 17 thousand no one wants to pay please consider this point. we want to learn quality code but not in this price we can't afford thanks!
@LaravelDaily3 жыл бұрын
Visit coupons.laraveldaily.com
@adiputra-og9qt2 жыл бұрын
why i can't run composer require maatwebsite/excel in my computer? this is my error: Your requirements could not be resolved to an installable set of packages. Problem 1 - maatwebsite/excel[3.1.36, ..., 3.1.x-dev] require phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.18.0, ..., 1.24.1]. - maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.1.6) does not satisfy that requirement. - maatwebsite/excel[3.1.26, ..., 3.1.35] require illuminate/support 5.8.*|^6.0|^7.0|^8.0 -> found illuminate/support[v5.8.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require. - phpoffice/phpspreadsheet[1.18.0, ..., 1.24.1] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension. - Root composer.json requires maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, ..., 3.1.x-dev]. To enable extensions, verify that they are enabled in your .ini files: You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions. You can also try re-running composer require with an explicit version constraint, e.g. "composer require maatwebsite/excel:*" to figure out if any version is installable, or "composer require maatwebsite/excel:^2.1" if you know which you need.