🔴 Open Source Dev Stream: New PR, Pint Features & More

nunomaduro| 02:28:39|Mar 14, 2026
Chapters8
Host confirms the stream has stabilized and asks for feedback on current performance.

Open Source Dev Stream dives into Laravel image processing, Pint styling choices, and building a new open-source PR for image optimization.

Summary

Nuno Maduro hosts a deep, meandering live-coding session focused on a new Laravel feature: an image processing API that optimizes and crops uploaded images. He debates architectural choices like driver vs. engine naming, and whether to place components under the foundation or a dedicated image module. The discussion covers drivers (GD and Imagick), the Intervention Image package, and dependency injection for file handling within Laravel’s container. Throughout, Nuno tests a plan where a pending image carries a series of operations (crop, optimize, format) and then uses the underlying driver to perform those actions, with real-time feedback from the chat about naming, defaults, and test strategy. He scripts tests incrementally, plans integration tests, and experiments with test-driven flows to ensure image processing behaves correctly when uploading and transforming avatars. The stream also touches on tooling like Laravel Pint for code formatting, GitHub diffs, and the evolving ecosystem around open-source contributions. In parallel, he sketches a testable flow: request image -> pending image -> choose driver -> apply operations -> encode -> store, with safeguards for missing extensions and runtime checks. The vibe blends practical Laravel work with live debugging, execution with Octane, and a candid look at open-source development in real time. Finally, the session closes with a peek at testing plans, future refinements, and a community-driven pace for ongoing improvements.

Key Takeaways

  • An image processing API for Laravel is being built that accepts an uploaded file, accumulates operations (crop, optimize, format) and executes them only on a terminal call.
  • Intervention Image (version 3) is wired as the GD/Imagick driver backend, requiring composer require intervention/image and a runtime check that the extension is installed.
  • PendingImage wraps the uploaded file and holds nullable operation attributes; encode/store calls are proxied to the underlying driver, enabling driver-agnostic processing.
  • Two driver naming paths are discussed: 'engine' vs. 'driver', with the plan to align config names (GD/Imagick) with the actual implementations.
  • Code formatting and linting are addressed via Laravel Pint, including testing changes selectively on new files to keep the workflow fast.
  • Next steps include adding integration tests for image processing flows (upload, crop, optimize, encode) and ensuring the temporary uploaded file lifecycle is well understood.
  • Streaming discussions also surface broader practices: dependency injection, service providers, and planning for future enhancements like multiple variations without duplicating storage.

Who Is This For?

Essential viewing for Laravel developers building image upload and processing features, especially those exploring open-source PRs, image optimization pipelines, or integrating Intervention Image with Laravel Foundation. It’s also useful for teams considering Pint-driven workflows and live-coding demonstrations to validate architectural decisions in real time.

Notable Quotes

"Nice, nice, nice, nice, nice, nice, nice. Good stuff."
—Momentum and troubleshooting as the stream resumes after a hiccup.
"We should actually be back now. Yeah. We are back here."
—Immediate reaction to stream continuity and stability checks.
"The goal for today is to build a new feature for Laravel, a new pull request which allows people to optimize the given uploaded images."
—Stated objective for the session and PR focus.
"Intervention driver is required to use the image feature."
—Runtime guard conveying dependency on Intervention Image.
"Crop the image, optimize it, and store it, all while keeping the driver agnostic until encode."
— summarizes the core flow of the pending image pipeline.

Questions This Video Answers

  • How does Laravel handle image uploads and on-the-fly optimization with Intervention Image?
  • Can Laravel Pint be used to auto-format code changes in a live PR workflow?
  • What's the difference between an image driver and an image engine in Laravel's image processing feature?
  • How do you test image processing integrations in Laravel Foundation with GD vs Imagick?
  • What are best practices for caching or storing transformed images in Laravel during a PR build?
LaravelLaravel PintIntervention ImageGD driverImagick/ImagickDriverPending ImageImage optimizationDrive vs Engine namingService providersOctane (Laravel)
Full Transcript
that we should actually be back now. Yeah. Yeah. We are back here. All right. We should be back, chat. Let me know how how it is now. We should be back, chat. We should be back. Is it streaming? Is it lagging now? Because if it's still lagging, that would be [ __ ] up. If it's lagging though, that would just be bad. Nope, it's not lagging. Nice. At least the just fix it now, you know. All right. So, I think seems to be okay. Nice, nice, nice, nice, nice, nice, nice. Good stuff. Let me just open all of this. Bam. Bam. Bam. Shad. Put like again below. Okay. Don't forget about that. So, I can close this. Can I close this? I think. Yeah. Smooth as [ __ ] Let's go. Okay. We back. We back. Shad. We back. We fully back. All right. Let's Let's get some work done. So we decided ourselves that we are going to use this API then to keep it super stupidly simple. Let's actually do that. Uh which is the one we originally just suggested which is good. We good. We good. We good. All right. In terms of architecture we have a lazy fluent builder pattern. So when we do request image returns a pending image that accumulates operations. Nothing executes until the terminal method to bytes save or store or to response. Uh correct may be correct. Okay, here I'm going to just you know try to understand a little bit this um so all this stuff should actually be proxied to the to the underlying file clause because Lavel already have a file class doesn't let me just confirm. Yeah, we have this uploaded file which has all of this stuff, right? So, we could potentially make it like just delegate all the way down to this. 100% sure we want to do this. Good question from Shivir. That's actually a very good question. What happens if I want two avatar sizes? One for small, another one for medium. That's a great question. You know, that's a great question. Okay, are people joining in? Let me see. Let me see. Let me see. I hate to restart live streams because a lot of people just leave and then to have the same numbers as before, it just takes like another 30 minutes. Okay, just kind of [ __ ] up. What's today plan? Welcome Veltx. Yeah, if you just arrived today, we are building a new feature for Laravel, a new pull request which allow people to optimize the given uploaded images. That's the goal for today. Okay. No, no clone is a bad idea. Okay. That's a bad idea. Demon start saying no. I stay. You're too awesome, dude. Thank you. Thank you. You're too awesome. All right. So, this can have returns a pending image. This should be this a pending image. I feel like this should be just image, not panning image. Panning is just lame. What else we have? We have contracts uh for factory engine. Oh, who do I want this? Maybe perhaps in the betweens your source illuminate image. Uh not good. Okay, there's a bunch of changes we need to make. All right, we need to make a few changes. We need to make a few changes. Yes, we definitely need a manager for the driver itself. That's for sure. facade image which is the thing you were guys talking about which is good config image.php PHP, which is what we talked about about being able to specify the driver that's necessary. This work this this is looking weird though. Let me just confirm it. So, if I go into source illuminate foundation, what do I see? Source illuminate. Where is the foundation stuff? FF. Oh, here we go. So, if I go into this user off thing, yeah, I see illuminate foundation off. So, this needs to be illuminate foundation image. All right. So note we are not actually for now creating a new component for this. Can you keep it simple and add it to illuminate foundation image uh folder? And of course the facade can still be at support level and the contracts can stay on the contracts um component because there is a component called it contracts in Label. Okay. But I want to keep the original two. Yeah, we are going to you know I will I will think about that. I feel like um having a file upload and wanted to basically have to store it twice is not like image related. It's more like file related almost. You may want to do that with various files. You know, Stony is saying the following. I think handling methods with array input and then get all the variations would be nice. I agree with you. You know, I agree. Potentially we're going to think about that. Let's just not think about that right now. I'm use the bathroom. Give you a moment. Yeah. Uh-huh. 1. Okay, we're back. Uh, so what else we need to tell AI to not do or do? Let's see. So, we definitely need the manager. We need a pending image, which I'm still yet um undecided if we should use this. We need a couple of engines which are going to be the driver behind the scenes. Yep. Yep. Yep. Maybe. I don't I don't like this approach. So here they should be just slashdrivers I think. So if I go to cache for example, what do I have here that separates the drivers? So I basically have image store, image wrapper, array lock, array store. Okay, so this will be like Cloudflare engine. It feels weird the engine name. Why did it call it engine? H bash what's up nice to see you how you doing what will be pending image it will be basically the class that holds this stuff okay corp optimize in store that that will be basically that that's my goal that's my goal okay chat by the way chat uh don't forget by the way chat uh don't forget go all the way down click like on this video if you can okay boom Okay, what else we need to do? Yep, yep, yep, yep, yep, yep, yep, yep, yep. Uh, penning image. Okay, optimize. Okay, using this is weird, I think. Yeah, we don't need the using thing. Do we need the using thing? I think we need the using thing because the default driver might be GD, but the user wants to change it to a different driver, for example. Um so yeah that that can that can be kept uh two bytes to response store and save. So here's the interesting thing. Um methods like store and save should be um proxied almost via call to the underlying file implementation. So when I do request image, this is doing um a new image with a file inside and then we always have access to the real file implementation. What do you think? Stream dying a bit? Oh my [ __ ] god. You serious right now? What do you mean? I have a problem with this. Um, is this thing up? Let me see. It's active. [ __ ] How about now? This is like destroying my streams and I need to fix it, you know. What do you guys think about the current live stream? Is it okay now? Is it lagging? Anything bad? Let me see. No, it's good. Like, what do you mean? Oh, now it's good. Yeah, I think like I really need to find a way of disabling this completely from my laptop. Oh, it's good, right? Good, good, good, good, good, good, good. All right, cool. We're back. If at any point it starts lagging again, just type F. That's the only thing you have to do. Okay? If it starts lagging, if if the webcam gets out of sync of the audio or anything, you just type F. That's it. And it'll know. Money maker saying open source dev. It's more AI models doing open source dev. I mean, we need to get used to it. like we don't code as much as in the past or we don't type the characters anymore in the past and everyone is using AI and we need to get used to it you know it's good it's good it's good all right let's continue to work on this what else we need to do here where is my terminal just disappear oh here we go um so we need the image the using uh Right. So facad facade level config image the interacting input will have an image key now which will proxy to the file implementation in resolving a pending image. Yes. Yes. Yes. This will resolve back the image factory. That's good and expected as well. image service provider. Do we really need an image service provider? This could almost be done at the foundation level. Well, I'm going to still do image service provider, but I think like this will potentially not a thing. Intervention image required to use intervention uh image driver. Yeah, this is a suggest 100% sure. A suggest will not be there by default. Key design decisions engine not driver for the contract name. Um, okay. I want to ask AI like why are we calling this engine and not driver? What do you think? Also, why engine and not driver? How do you set which coding style rules belong to the default lot of alpine preset? Um, personal preference. Exactly, Bruno. Well, from my un from my experience, I think most like 99% of the decisions I have taken so far on the Laval preset, people are happy with it. So, Dukaten, hey dude, how you doing? Nice to see you here. And thank you for the subscription on Prime 10 months already. You are awesome, dude. Yeah, regarding pint, it's basically up to preference indeed. That's it, you know. Literally up up for preference. That's it, you know. So, why engine and not driver? That's a question I want to make. Uh to AI. Yep, this is correct. Operations in plain arrays, method corp, erase arguments, engine interprets them, and keep the impending image driver agnostic. I'm not sure about this. Yeah, I'm not sure about this. I'm going to let it do for now, but I'm not sure. Using yes, optimizing controls encoding intervention format quality for optimizing. Cool. All right, let's just do it. Don't forget opinated. Exactly. Laravel pint is a opinated package. So if you don't want to, you can use other styling package. Okay, great feedback. You are right in all counts. Uh, foundation image, keep it simple. No new component. Yes, yes, yes. Request image will be a new image file. Thank you. Thank you. Image wraps the uploaded file directly and calls in the d-core calls uh the proxies for the store driver standard LL convention. Yes, it is. Yeah, this is just expected the normal stuff. All right, let's let's let let's have him cook it for now. The context is still 20%, so I think it's okay to move forward with this. Do you see pint involving behind formatting into automated uh code improvements? I mean there is a few things I wanted to do on pint that I haven't done it yet because I don't I didn't find the time but I think I'm going to end up developing for example this rule on pint which I don't know how many of you have faced this uh but but technically if you have an is set array thing for example if you set fu you do a if not you do b for example okay like this can be literally translated to this I think. Wait, if it's set then A. I think that's it. Yeah. Otherwise, B maybe. How do I [ __ ] do this? Oh, like this. I'm sorry. If it said Yeah, exactly. Huh? Wait, now I'm confused. One second. PHP double operator. How this is called even? I forgot the name of this. Oh yeah, 100% sure. Missing something. Do you guys remember how this is called? Maybe it's new colisent operator. Let me see. Oh, it is. Yeah. Okay, here's a good example. Okay, previously like if you want the username to be either what is there like let's say uh request user or nobody um you would have to do this crap right here. Okay, which is like super confusing. And in theory what I could do on pint is that I could have pint styling to this new option to this new format basically and pint does not do this and this is opinated because some people like may find this confusing even you know uh but this is kind of sort of things that pine can do. Mr. Pu is saying use Recctor for that dude. Uh Pu something you need to understand is that like 99% of the PHP developers don't know what RTOR is. Okay. And Recctor is not on Laravel. Um I understand you know what is Recctor. I also know what is Recctor and I'm using it. Uh but like if you ask a normal PHP developer doing 9 to5 jobs without having being on Twitter and [ __ ] they don't know what Recctor is even, you know, and they use Pint because it's just on Laravel by default. And uh that's it, you know. potentially if RTOR would be a default thing. Uh we could consider it but uh it's just not there. Okay, Recctor is awesome by the way. It's just not, you know, people just not do not know Recctor as much as they know Lavo for example. But he's lovely. I love Recctor by the way. Okay, how we are here? So it is cooking already including adding tests which is positive. We are on PHP 8.5 which is good as well. Let's see what we have already. So we have intervention image being added to the suggested array which is positive as well. Yes, good stuff. That's no different. That's exactly the same code. By the way, the code I have show you, it's exactly the same code, just smaller. Basically, this is equivalent, literally equivalent, the same thing. Exactly the same thing. It's just this is modern PHP basically. And I think it's been in PHP for a while now, Ducatan is saying, what is the terms what is um a service provider? So in Laravel you may have a series of classes or a bunch of classes that need to be initialized at boot time at Laravel. So for example you receive a request and you have all these features like eloquent and um you know authentification and everything you may actually need to run some code before actually using those features. So that's what service providers are. They are they exist so you can run some code at boot time when Laval is initiating basically. Yeah, there is also the exclamation exclamation point equal in PHP. Indeed. Indeed. Soon a PHP artisan check. That would be that would be a good idea indeed. Everyone is making nunoite questions. That's okay. Okay. So, we need this for sure. Uh what else? Config image. We don't have nice tailor comments. Let's actually have that as to-do for now. Okay, this will be to-do. This will be to-do as well. Image driver default intervention. Shouldn't this be like GD almost? Yeah. Why do we have an intervention name here? That's weird. All right. Uh question. Why intervention is the driver and not GD directly instead? I think intervention is just the underlying way. Let's say the framework uses GD. That's it. Yeah, it should be GD 100%. That's just weird. That's why I'm asking AI to fix it. What does boot time mean? Uh so boot time is when Laravel is preparing to receive a request basically. Okay. So you have a request coming Laravel boots and then service your request. So that's what boots means. It doesn't mean deploy. It means like it's a code that runs before you serving your request. That's it. Okay. How we are now? Yeah. Now it's looking much better. basically this I think like this will end up having a bunch of options just below. Um but yeah, for some reason I'm starving. I don't know why. Okay, this is looking good. GD image for now. Yeah, this is just perfect. Like easy peasy clean. Okay. And GD by default 100%. Okay. What do we have here? What do we have here? We have driver in operations. This is looking very weird. Uh but let's see. Image manager. Yes. Intervention driver. Why the AI is not using property promotion here? Oh. Huh. And why this is called a driver? That is very weird. All right, a few things. Um, oh, because this code will end up being shared. H, right? If I were to have multiple drivers. Oh, that's why we're using intervention as a driver because the code itself will just be reused across the GD and imagic. That's a good point. So, if I were to go to let me see into source illuminate. Do we have stubs? Where are the stubs? Oh, here we go. Into queuing. I see default database right. How about for example cache array database file BM cache radius dynamob octane fill over blah blah blah blah. So I see store the concept of store and then array driver array. That feels weird like why array a driver array? Can the array have another driver than the array? Maybe it can and I'm just confused. file driver file. Yeah, that's the stuff I'm confused about. Pua say my comments are not appearing on stream. What do you mean? I'm literally seeing him right now all the way top because you are cooking good [ __ ] Thank you. Thank you. Thank you. Cooking, cooking, cooking. By the way, Shad, you guys are absolutely awesome for being here with me today. I appreciate. Uh, can you just like store name not driver? The thing is that store feels weird as a name for images because well, store is for caching because you want to store those cache values somewhere. Um it does not make sense for images. You know images it makes sense drivers basically. I was having lunch. What did you miss? Not really. We started the implementation of the image stuff which I assume you were there already when we started talking about it. Yeah. This driver situation is looking weird. Maybe like it might be the case for an abstract class basically. Okay, we may actually consider that. All right, I'm going to just say the following. All right. Um, just notice that we have GD and IMAG drivers on the configuration, but the implementation we call it uh intervention driver. Can we maybe have an abstract class or not? Not not that even. Um, can we make it in the way where we have image driver and GD driver and I'm going to so I'm going to move this into plan mode. So I want to see like the suggestion from cloth code. Do you see pint leveraging in the future for automatically suggest code improvements? No, not in pint. Pint is a styling tool. That's it. I think pine pual is also starving. I'm honestly starving. I'm going to get a yogurt. I will be back. [ __ ] You're right. Thank you so much for the new followers on Twitch by the way. Appreciate it. Push the like. Yes, Shad. Put like on the video. Okay. If you're watching this video right now, don't forget, put the like. Do you ever eat the cloud code limit? Not yet. I haven't haven't reached the cloud code limit yet. Having this nice yogurt, chat, 25 grams of protein. Okay. By the way, Shad, I want you guys to be healthy. Don't forget, go to the gym. Have healthy food every single day. Anyone writing their own code or you just use AI these days? I think most of us here just use AI. Do you want you want to make a test? Let's let's try the following. If you use AI all the time for coding, just type yes. If you don't use AI at all, just type no. I think everyone will tell you AI, honestly. But let's see. Maybe some people don't use AI. I don't know. I told you, dude. Everyone uses AI, dude. This is crazy. Oh, that was so good. You are in between. Yeah, it's normal. It's all good, dude. It's all good. Okay. What's the plan here? The config exposes GDN image as driver names, but the implementation has a single intervention image class leaking the intervention implementation detail into the class name. The driver should match uh what user see on the configuration. So, delete this. have intervention driver abstract class that's what I was thinking literally abstract class that have a create manager and we just use Yep we just do create manager that returns GD or not exactly this Yep you can do it without clearing the context I don't know why cloth code always suggests me to clear context I don't want to clear the context dude if you clean the context it will produce no Good code. Huh? Do you use act for GitHub? What is that? What is that, dude? Wait, there is a research who correlates AI with the use of slot machines. Do you feel you code more? One more prompt. No, I don't feel that way. When I'm done, I'm done. I also don't think I have a prepos preposition disposition for basically being like a slot guy like I don't I don't I don't really enjoy casinos. All right. So we have an abstract class called intervention driver which implements driver. We have the manager itself. We have we create the manager just like that. And then when we process We at the rear of operations. Yeah, this is looking okayish for now. Yeah. Okayish. Honestly, there's a bunch of like comments that are not necessary. Going to run pint against all of this. Can you run pint individually against all the new files AI for boring things? Yeah, that's a goal. Fmentoto, welcome to live stream. Yeah, today chat by the way if you just arrived to the live stream let me just show you what I'm cooking on. I'm working on this new feature proposal that is basically what I kind of need for my projects. So every single project I work on have some sort of avatar upload or image profile upload and I kind of want something simple uh that store those images but before of doing that kind of optimizes those images. So I want users to be able to optim to upload the 4 megabytes image but I want to kind of corp those those images but also optimize them a little bit to webp and things like that. So what we are developing today it's basically this small and easy API where you just do request image avatar crop the image optimize it on webp format and store it. That's it. So I want to kind of have a very simple API that does all these things. That's the goal chat. That's the goal. for this is not better to run vender bean pint. Well, that happens on regular Laravel projects. Here we working on the framework itself. Things are a little bit different. Okay, things are a little bit different from that. Um, I can do something though a little bit more crazy out of the box. Do I want to do that now? Yeah, maybe not. Yeah, here things are a little bit different. Okay. All right, I'm going to ignore a little bit the implementation on this one and I'm going to check it out later. Okay, I want to kind of see a overall picture of what we are doing right now. So we have the uploaded file as a constructor argument which is what I've asked for uh we equally have the array of operations which is the cumulative operations to send to the driver itself. I definitely don't want this to be like this, but I'm going to be back in a second. Optimize. This is the driver used. Yep. Yep. Yep. And we don't need any of this. Like the true response is literally useless. It is useless though. Maybe. Let's not do it for now, I think. All right. I'm going to just say the following. Um, remove the two bytes and two response Happy Friday. Nice to see you, dude. How you doing? You were thinking a dedicated operation class perhaps. That's what I was thinking. Perhaps either a dedicated class or having those as arguments uh as a regular attributes of the class. PHP FFI. What do you mean? Oh, that leave VIPs. Okay, so that got removed. Nice. Good [ __ ] Um, nice. Nice. Nice. Nice. Nice. Nice. Nice. Nice. Nice. Nice. Nice. Nice. So let's do the following real quick. Can I ask something? That would be nice. Against the new files run dash pint pint and then I'm going to go to our custom pint. Can I delete it for now? Yeah, I'm going to just delete it. Let's see how it goes. I'm doing here a trick which is I want to use the new version of pint only on the new files I'm creating without the default Laravel configuration. And in theory now if I roll back this. All right. Do it again but now against vendor bin pint. And in theory all of this should just be better now. Yep. I don't have any more like the the arguments the the PHP docs here which is good stuff. A little bit more clean 100%. Yep. Yep. Yep. Yep. Yep. Yep. Yep. Yep. Yep. Yep. Yep. Yep. Yep. Yep. Now, we don't deploy on Fridays, chat. We just relax. Okay. No good at deploying on Friday. By the way, I've used PHP FFI in the past and it's literally super powerful. By the way, if you don't know the context concept of PHP FFI, this means uh being able to access C libraries from your PHP code, which is something that technically was impossible in the past, but now you can literally do FFI blah blah blah and then execute C code as you can see here. Okay, great. FFI is super cool thing. Well, super cool thing. The thing about uh FFI is that first of all, it's not enabled on the web layer by default. You know, most people think like, oh, FFI is awesome. I can just use it. However, FFI is not enabled on the HTTP layer by default on PHP. So, you are able to use it on the console, you know, just like on the console on the CLI, but like on the on the web layer, you cannot use it. Super good information, huh? Good information, chat. By the way, don't forget, go all the way down, click like on this video if you're having fun today. I'm having a bunch of fun with you all today. Okay, you guys are absolutely awesome. All right, so we are one step closer to what we are doing today. We now have intervention driver as an abstract class and the image just do this and the GD just do this, which is exactly what we want. So expect going to the manager and the manager is just basically proxying all the way down to GD and proxying all the way down to imagic. What is this insure thing? Oh, ensures the class is installed which is a good point. I don't like the tone of this exception though. So we may have to adjust this. Yep, we need to adjust this a little 100%. Uh uh uh. Let's click on it. Let's actually Yeah, if the CL this can be imported by the way. It doesn't have to be like this even if it does not exist. Oh, let's call it image manager as well. Okay, let's just call this intervention image manager. Let's create an an allias. All right, here we go. So if that class does not exist then we throw an exception which is a runtime exception saying intervention image is required to use the image feature. Okay. I want to see like the S3 driver equally have the same problematic. I want to see if we are throwing a runtime exception here. We are not or we just basically just assume the user have that installed. We do. Interesting. All right. Well, in that case, I'm going to just throw an exception saying intervention image is required to use the image feature well with this driver. Okay. So, this will be a little bit different than this. So, I'm going to just say the following. Um, on the ensure intervention is installed, which I kind of want to rename this. Yep. Yep. Yep. Rename this ensure requirements are. And then I'm going to just do this also on the exception message specify the driver that was requested. So we have a nice feedback on exception if the users do not have that extension that intervention package installed boom FFI is for high performance. I agree what's up dude nice to see you all. Today is Friday 13. Dinosaur. I had no idea, dude. Deino, I had no idea, dude. There is a very special place in the hell for those who push production on Fridays. Honestly, feels like Cloudflare is doing that right now. Cloudflare is always down. It's just like insane. Cloudflare is just, you know, it's been so down recently. Intervention image is required to use the image blah blah blah blah blah blah. install it. Yeah, this needs to be you may install it via you may require it via and this will be composer require intervention. I'm going to actually do this. Yep. Composer require intervention imagic is intervention imagic. Oh [ __ ] I forgot the package name. Oh, just this. Nice. And to be fair, we probably should be a little bit specific here about the versions we support. Let's keep it simple for now. But uh yeah, do you want to keep it simple? Maybe perhaps in the between. Do I want to do this? Yeah, I think I want to do this because I want to be specific about the version we support at Laval. Right. This is version three. Exactly. All right. Let's keep it like this for We actually need this, right? So, let's type uh d-dev. Nice. Good stuff. Good stuff. Do you use PHP FPM or Octane? I am using Octane all the way down. All the time. Yell is saying, "Clothflare be like, don't worry, I got your website probably." Maybe. Well, wait. Yeah, Cloudflare is been down like a couple of times already. GitHub is even worse. Like, GitHub was down 90 I think it was down 9% of the time in the last n in the last 90 days. 9% of the time. It's just insane. Like one out of 10 hours was always down. Nuno, I found a bug in your stream. Okay, what is the bug you find? you found. Tell me what's up. What did you found that is a bug? Like if I remove a comment, it still appears in your stream. Oh, yep. I don't think there is something I can do about that. I don't think that's fixable. Uh, so this will make sure the driver the requirements are met. Okay. I like much better this name. GitHub always shows unicorns 100%. Dude, it's just insane. What is this crap? Do I have to do it this way? No, we can do much better than this. Yes. Yes. Feels to me that the can be just more modern in terms of typing. All right, let's go back to the start. We are now requiring intervention imagic the version three. Okay, on the config image we proxy to GD and we have image driver. If I were to go to database for example, we equally we have database connection of course. But if I go to cache for example, we have cache store. Do we have any example with with driver or are we the first ones? Okay, we have concurrency driver, ash driver, image driver, qfill driver, session driver. Okay, this is the best example ever. Session driver which is database. And then we have a few options we can tweak. Nice. And this is this is exactly what I think we are going to end up doing is like we want to tweak a little bit like how images should be preserved by default. What type of format the optimize will be by default as well? So, yep. Yep. Yep. Yep. Yep. Yep. Yep. Yeah. Q driver is a good example indeed. Do you think we can add enum for the supported drivers? So, there is something I don't like about enums which is enums don't give you good discoverability almost. Okay. Um, you need to import the enum. You know, it's kind of good for apps like regular apps. I'm a big fan of enums. I love enums. You guys know that. But for open source, it does they don't give you like good discretility. Ideally, like you want to go to you want to go to a class and just do something like optimize or whatever and then you do uh you just do two and you have like all the optimized optimizations you can do. You know, that gives you good out good discability. Not enums. enums you need to import to find out that is an enum to begin with and blah blah blah blah. So I don't know I will think about that. I I potentially will support both. Um okay. So this is much better. This is good. This is very good. Tweaking my OSD like what is GD and this is width. Okay, let's see why. Oh. Oh, that case is just GD2. The [ __ ] Imagic. Imagic driver. Just imag. Yeah, here we go. Much better. All right. Nice, nice, nice. Create an underlying intervention image manager. Nice. Good stuff. And this returns an image manager, which is something we have ourselves. So if I do image manager GD, I get the good image manager. Okay, let me go here and see what this image manager is about. So the facade will equally resolve. This is basically the proxy for the facade, I think. Let me just confirm. Yep. This is literally just the proxy for the facade. Yep. Expected. Good [ __ ] Good stuff. Good stuff. Good stuff. What are you guys working on today? It's like 6 p.m. in Portugal. What are you guys acting on? You guys acting on something fun in your side? Let me know what you're doing at the minute. My wife told me that you need to drink a beer in the what? Oh, what are you saying? Oh, my tweet chat is broken. That's why it's not showing [ __ ] Oh my god. One second. There we go. And it's back, I think. A good website for my favorite MC rapper. That's so good. Jonathan Coaster, by the way, someone just shown me your uh just so sent me your project today. Um the fourth PHP thing that looks exciting, dude. Tell me something. Is that project what we originally were thinking for Pint like back in the days? Are you were you still using some of that stuff or just completely just rebuilt it from scratch? When did you get a setup tour? Oh, dude, you don't want to know. My setup is just horrible. Honestly, I it's just so bad. Honestly, I have like two lights. I have my office in my room and that's it. Like, it's just the most simple stuff. Maybe one day I will have a proper setup. Joanita is working on a new package for dynamic HTML. HTML for Laravel. That's a good one. in the pub. Oh, that makes sense, dude. That makes much more sense. Okay, this is looking okayish. I'm almost thinking like does it needs to this needs to be an abstract class? I don't think it needs to be an abstract class. Well, maybe he does though. Where is the right? I spend some so much like most of my time like this will feel hilarious for you guys but like most of my time right now is spent on this GitHub UI like I don't know if any of you also feels the same these days but most of my time is spent on this GitHub desktop UI thing because I just want to see the diff. I want to see what the AI is producing. Okay. And the best tool I have found so far to have a diff of the changes is literally GitHub desktop app. I am only on. Maybe I'm the only one. How do you guys even check the diff that was created by AI? This is the most productive way I've found so far. What do you think about PHP 8.6 with Python? Wait, what? Why would PHP 8.6 have Python on it? GitHub Daxtop for the win? I agree, man. Facts. Literally VS Code. The thing is that does VS Code gives you like a nice diff like this though? Didn't PHP Storm have a diff preview? I don't know, man. It does. Where is it? Like, I cannot see it. Like, if it does, I have no idea. Like, honestly, it's not as nice as GitHub Dextop. Exactly. That's why I'm always using this. Like honestly, it's overrated. All right. Something we do need. So, we need to we need to take two decisions. Okay. The first one is that if we are happy about this being abstract class. Okay. Feels weird to me. I'm going to be honest with you. 100% sure feels weird. This is this should just be called intervention. That's it. It should be at root level. Okay, let's let's actually plan that with cloth code. Feels weird that is within drivers even if I is based on it. wondering if we shouldn't have intervention.php at foundation images level image level level and just accept a manager on the constructor. Let's let's change this to plan mode. So when I move to plan mode, I'm literally just prompting AI and you know getting the feeling like the mood. Developed by Josh is saying my junior developers are always looking down on me for using uh the kit the UI for git. Why? I like it. Stevie is saying the following guys. It's just me or it's hard these days to change job. Well, are you a developer yourself? If you are a developer yourself, uh, do you want to change jobs? Is that a good idea? Oddfix is saying PHP storm has a diff window. Okay, didn't know about that. That's a good thing to know. Kokai, what's up, dude? Nice to see you. By the way, chat, if you enjoying today's live stream, don't forget go all the way down and click like on this video if you are having fun. Yeah, I may I may have to double check that Jet Brains diff situation. Let's see what uh cloud code thinks about my move from intervention driver to just Intervention driver is an abstract class in drivers with GD and image extending it uh and overriding it. This is unnecessary interaction and if intervention just accepts email manager on its constructor blah blah blah blah blah blah blah will become trivial blah blah blah. Exactly. So you just remove this. You create image intervention a concrete class not an abstract. Exactly. Implements driver. Does he need to implement driver though? That's the part I'm just [ __ ] confused. Oh, it does because the the actual operations are equivalent. Yeah, this is smelling. Okay. If it needs to implement driver, maybe it should actually be abstract and a driver maybe because if I go to not that is like super modern but like eloquent for example, if I go to eloquent I think we have actually something very close to this. So if I go to database eloquent. So here I should have something like is it here eloquent? Yeah it is. Uh is database. No no no it's not eloquent. Here we go. Processors. We have a bunch of processors and all of them extend this processor base class I think. Here we go. Which is exactly the same stuff. No, I think we're going to keep stuff like this then. Never mind. Let's keep things like this for now. Uh, don't do anything. All right. Uh, we're back to where we were exactly. So, we're going to keep it for now. At least like this. manager read resource. One second. Uh, Stevie is saying the following. I'm a developer. But over the past year, I felt that my profession growth have slowed down. At the times, I even felt like I was moving backwards. Well, maybe it's time to change to not do another job, but uh Oh, by job you mean like to go to a different company? Oh, I'm sorry. I thought by job you meant like professionally changed to a different type of job basically. Um, so I think like when you feel that you're not grow growing, you probably should just move to a different company. That different company will give you different people to work with. Maybe some of them are like more experienced than you. You can just learn a few things after that. You can also do like open source stuff that's so useful and also to get you uh people to know you. Live viscode is saying three months without job. Oh, I'm sorry, dude. There is this website called a lot of jobs.com. Have you seen it? Because if you're a laval developer, you can probably find stuff over there. From where do you learn React? Oh, myself I learned alone literally when I had to develop Laval Cloud I was just you know React is super easy to learn as well you know you know like it's not like I had to spend three weeks learning React. You're welcome dude. I don't know what you guys think. Do you guys think Do you guys find React difficult? I don't find React difficult. Okay. So, this is implements the image ex this should this is doing what I what I think it shouldn't do. All right. This is looking weird. Demo story is saying React is super simple. That's why it gets ugly on real big projects. Yeah, I kind of wish React was more more opinated almost. Well, that's why we have Well, you could say that's why we have Next, which is probably the opinated way of developing React apps, I guess. Use effect doing loops. I kind of wish they would fix that honestly. The use effect debugging or, you know, having use effect like [ __ ] rendering your component three times. It's just so annoying. Joanito is saying that Brent in Roman had a stream today about XDbug. How did it went? Can you explain me via um uh diagram maybe all this stuff? Okay, I know why I'm getting confused. It's because we have an image manager, but intervention also had an image manager. Oh, okay. And when we do when we return GD driver for example, we're returning this one and from this one we get the image manager from intervention. Oh, okay. Now all of this makes sense. So if I go to for example, if I go to the abstra class which is the one I originally wanted to this one when we say create manager we are actually creating the image manager from imageic exactly from uh intervention I'm sorry okay now all of this makes sense Jesus Christ took me a Yep, yep, yep, yep, yep, yep, yep, yep, yep, yep, yep, yep, yep, yep. Demon is saying, "Next GS was nice with pages, router. Now it gets ugly with so much stuff." Yeah. And I think NextGS will potentially have I think well I don't think I'm sure their goal is like to be this full stack framework like you know over time I think you are going to see next as like I would even say competitor of Laravel honestly because I think that's what what what potentially they're aiming to think. I'm not sure though. Okay. But I think what well if I were them that's what I would do like I would try to compete with Rails and Laravel even you know. Okay so this stuff makes sense. I kind of wish you could just rename this to intervention image manager but I think we cannot do that. Yep. Okay, now this makes sense. I think the only thing I want to cover now is the operations array thing. This is looking very weird. All right, so no changes needed. Exit plan mode. Thank you. Uh let's no need to clear the context. Uh let's now so no changes uh needed. Next let's talk now about the operations array. Kind of wish we could type all of this. Does it make sense to have this potentially as like image options or just simply have it as properties of the class? Okay, let's see what he says about this. Adonis is cool. I tried it. Uh it's super fast then uh super fast like Laravel. Yeah, but it's JavaScript, right? I think which is a good question for you all. Like does any of you have developed a full JavaScript application with authentification with cues with mails with you know with the the full story? Does any of you have done that? And if yes, like what is the experience actually? Cuz from my understanding, you need to just import a bunch of just a bunch of various things to have it work. That's what I have heard. Well, Shidak is saying why don't you use tools like Whisperflow or ST? So, tell me like for if you use ST, do you get all of this stuff by default or you just don't get it? Like that's my question. Like if you use those frameworks, do you get all of that? You still need a lot of tooling. what I'm using for AI cloth code oo 4.6 Six. Okay. Apparently, we have type of operation classes or just this. Uh, what happens? Press N to add notes. No, I actually want to see those notes. How do I open this? Chat about this. Skip the interview and plan immediately. Oh, it's asking me what I should do. Let me see. So, we have image.php, which is right This should this this really feels like a panning image almost. Yeah, I think we should rename this to panning image and then we could have the operations like we are going to do just right here. Although the image options will be kind of nice. If we were Yeah. If we go down this path, this will lead to a bunch of options and then this will be a nightmare in the future. how the GD driver would behave like this then let me see like when we are actually applying those options. Oh depending of the operation type yeah all of this stuff sucks. Do they offer though some sort of at the very end what's happening? Oh we encode. So encode is the very last thing to call before actually having like the string version of the image. Interesting. Interesting chat. Hope you guys are having fun today with this live stream. Obviously it's just so deep into into open source and yeah open source is not always fun man. You need to just dive into some of these topics like understand code you haven't wrote yourself. Um it's not application code. It's like a little bit more you know just different you know because you have to deal with various cases and potentially prepare this for future drivers. So it's just much different than uh applicational code but hope you guys are having fun today wun no thank you thank you thank you thank you I love because of filament filament makes me don't think about UX and UI it's not like you have to right right now right because with cloth code you can just ask for it. So leave his live code is saying the following. Yeah, with AI you use so many libraries in online services blah blah blah blah blah blah serverside components and it's PHP copy. I know dude is saying the following but why are you using cloud code directly in which CLI? So I'm using cloud code CLI with cloud code oo 4.6. So just using the CLI normally which is this one. Okay. Bruno is saying, "I have learned how to code lot of val watching your source code." Oh, thank you. Which application have you used uh have you checked the source code on? I assume it's an open source one. Was that Pinky the starter kits. Uh uh uh. So here we have to do a bunch of operations up front and then we need to call the encode thing. The encode is the last one, the last piece of the puzzle. Okay. Let me see what what they do have as an offering. So, let's just um chat about this. Okay. Actually, can you maybe explain what other options we have? This feels untyped. So, I was wondering if the user calls something like uh crop, we just proxy to the panning image class. We would either keep these options or potentially just proxy already. Oh [ __ ] Oh wait. Oh, proxy already to the underlying driver. at the very end call create or even encode to actually do it. Any suggestion? The thing is that with with a driver like Cloudflare, you cannot actually just oh can you crop it? Can you do it? Blah blah blah blah because it's an HTTP call at the very end. So maybe like the operations make sense and maybe like we just use an options class basically. Let's see what cloud code will tell me. But maybe like using an option classes will just exactly what we are going to end up doing. Oh, was Pinkery? Well, Pinkery is a very solid PHP Laravel application. Although I must tell you that I was using a very eventdriven approach and I'm not fan of that approach anymore. Yeah, it couples the image to the driver early. Option D, we have option B and D directly. We don't have option A or C. Like what the [ __ ] Option uh D returns a pending image that wraps a library clean separation refactor. Um right just option uh B and D directly. No, no. A or C. Like why cloud is hallucinating? Yeah, it's a lot of context already. Soon they're going to have to clean it up. Option F 100%. Developer Josh is saying, I'm going to work on the starter kits this weekend. Going to pull all the recent updates into the React in view ones that Wendell was worked on. That's nice, man. Option W 100%. Uh library cleanest separation would be bigger refactor. Uh can you explain me the option D? Also explain me why there is no option A or C. Okay, let's see. We can potentially have the incode at struct level 100%. We should be close to the to the final context. So, okay. I want to I'm going to check the answer like why didn't you have an option? Oh, the option A and C was the one they had before. Okay, gotcha. Okay. Option D in detail. uh request image gets the file pull from the request resolves the driver from the container blah blah blah so that's was expected pending image wraps a very specific image instance has corp match optimize color oh I don't want this yeah so maybe the operation stuff is like the actual good option after all yeah all right so let's do let's do something else let's actually do something else rename the image class to pending image and uh create a new class that allows me set all these various options uh potentially uh pending image options even though could let's even though pending option like image options could be on the image itself. Yeah, but let's just do pending image objects for now. Yeah, pending image options for now with all the possible options for now. Just uh the corp one and optimize and format actually. Well, optimize and format. Joakanito, the that phrase is scary. What do you mean? Oh, the absolutely right. 100%. They don't do it that often anymore, actually. The absolutely right thing, they don't do it that often anymore. like they 100% added something to the system prompt to remove it. I think there are two things they don't do it anymore. The absolutely right thing they also don't do the delve situation. Do you guys remember what you every single time you would ask something like can you rewrite my tweet? It would just say something like let's delve into something because the del thing is gone. You know there is an option for compact conversation. Every single time I compact anything, it just becomes bad after all. After all. Okay. Image will be renamed to pending image. Same location. Foundation image changes. The class name is image. Pending image. Replace operations with pending image operations. Exactly what I want. And this will basically corp exactly. Format. We'll just the d- call checks the options has values instead of empty operations. Exactly. pass these options to driver process instead of operations. Exactly what I want. Just move forward. Yep. This needs to be nullable because the user may not want to actually change anything. So that's all expected. So if I go to pending image, I see a bunch of nable options which is 100% sure expected. Can I just tweak these options right here if I want to? I don't know why it keeps mentioning quality. Uh I'm going to just say, can you remove quality for now? So, which ones we have? We have the width, the width, and the format. That's what we have at the minute. And that's the only thing I want Also the has changes can be array filter uh with account quality equals to compression. Yeah, I know about that. But the thing is that if let's just think a little bit, right? If you ask to intervention that you want to corpse something, crop something, you don't actually specify the quality. I think this is a nice refactor right It wants quality for optimization. like if I were to call optimize, right? It's still um Oh, that's a good point then. So, if I go to pending image, I see like optimize and we see format and quality. Okay, that's a good point. Never mind. So, you guys were right. So, add back the quality to the optimiz optimization method to that's a good point, chat. Thank you. Thank you. Thank you. So you guys are saying that I'm going to see right now here quality which is a good point. So but it shouldn't be Yeah, exactly. in quality at 80%. It should be nullable though on the options though, right? Yeah. I don't get why we see like um this should be nullable because if the user doesn't call optimize, this should be nullable. And the this can be just this basically on use array filter array uh this this is a small trick shad this is like I don't know if you guys understand this but like literally instead of doing this you can just do you can just cast the given this to array. And what this will do is just map every single attribute to a to his value as array. So as you guys can see, it's just way more clear. Can you guys see it? You guys cannot see it. Let me show you. Uh pending options. Okay. To understand if these changes like I just do array filter. I casted this to array and then I just count if I have more than one change basically. Big engineering. Ask AI to edit two characters. Dude, I know, man. You know, that's what I just do, man. This is crazy. You know, I just ask AI to do it and that's it. But I I I could have done it literally. I know. I just I just get rusty as well, you know, if I'm honest. Like I'm getting rusty actually typing the stuff and I think at some point we are going to get rusty as well like actually typing like all this code. Um cuz even typing the text to the AI I I feel like we are going to end up talking to a bunch of these tools. Like we're going to just say can you do this? Can you do that? I think this is better. And the AI will just do it. You know everyone is getting rusky. I don't even know how to write PHP anymore. I know, dude. I know. All right, this is looking good. So, panning image options. We have image pending image, right? So, let's just recap a little bit. So, when we This is looking fantastic. So, we have a pending image, which is what we get when you do request image, which will have the underlying file uploaded. We'll have panning options. We'll have a driver which will be GD, imagare for example. We have process it. Why do we need a process it? Let me think. Do we need a process it? Let me think why this is even used. Process it. So when we call the underlying file call, okay, this will need to be a mixed in by the way. This will be a mixed in of uploaded file. So we have nice auto completion. Okay, that's important. When we call the uploaded file, we're going to check if the well, first of all, we need to change things and if the image haven't been processed already. If it haven't, we are going to process the image with those options and we call this resolve driver which will return this driver itself. Let me just confirm. Uh uh uh. Yep. Because it might be GD. Might be whatever. Okay. All of this makes sense. Yep. Yep. Yep. Yep. Yep. Yep. Yep. All of this makes sense. Yes. Yes. Yes. Yes. And then we process the image by getting the real path from the uploaded file and we just override it on the spot with the new information. We just do file put contents here. I think I want to do something a little bit more badass, which is I'm going to get the uploaded file. Can I do I have a replace or something like that? That would be nice. File replace put. No, I don't. Okay. Well, in that case, we just inject here file system. Uh, why are you complaining all over the place though? Oh, because it's missing a comma. I'm sorry. So, here we inject file system. I'm going to actually ask AI to do that. Uh, because otherwise this won't be testable. You know what I mean? This won't be testable. Exactly. Okay. So, I'm going to say the following. on the pending image there is a file put context direct call that is not testable. Can you inject file system? Uh this will be illuminate support file system I think. Let me just confirm. Oh, it's illuminate file system. File system actually. Okay. Can you inject the file system and use it instead? Make a small pause to use the bathroom. I'll be back. Wonder. This is lame though. Like why is he doing that? Don't use the container. Use dependency injection, please. Here we go. Here we go. All right. Let's take a moment to see the chat. You guys can call all vibe coding get rusty more market for me. Let's go. We vive engineering. Um, we master our domain. We just don't type it. Exactly. Exactly that. Sido is saying the following. Every time I try end up fighting with some LLM till I get fed up and decide to do it myself. Yeah, here was just you know was kind of missing an import. So we chill and back to the game. We good chat. We good. Great question though from uh Fobbrun which is asking the following. What's happening with IDs like Jet Brains? So I think Jet Brains need to adapt like and I think it's taking too long honestly. I think they have developed something though like someone was telling me Jet Brains Air or whatever. How is it called? Maybe it's done already. Jet Brains Air. Yeah, I think like this is what I need to try start using. Yep. There is so many tools like this right now. This is exactly what we need to start using shed. Basically, if this have a nice diff, we should definitely start using this. That's it. What do you guys think? We just do a stream about this about Jet Brains Air. Could be nice. What do you guys think? Have Does any of you have used this already? Type yes if yes. Type no if no because it looks cool. I wonder if I I can have a a nice diff like GitHub desktop though. If I can. I think that's enough already. Yeah. Protected file system. Exactly. Why the [ __ ] do we have this that way though? This is so bad. Protected. Here we go. Much better. Jetra products are addictive. Uh if this is Jet Brains cursor, it will be good. I think it's more than cursor now cuz cursor have been well historically it was an IDE and then you have cursor v2 which has like some sort of aentic UI but I think like this air situation is literally like not even a PHP storm editor is literally like an agentic editor which I think most editors will have to be at some point. I think though like editors like this where you just type code there will be just gone like in a year from now 100% sure. Michael is saying the following. You prefer asking an LLM to code for you or you just code yourself? I'm fine with LLM's doing this for me. Shad, this is looking very dope. By the way, panning image with a bunch of options. The user may tweak those options and if those options were ever tweaked, basically we actually do the stuff. This is looking fantastic. This is actually looking fantastic. Has changes. Then we actually process the file and we just re rewrite the the real one. This is looking very good by the In theory, this is already usable by the way, which is I'm very curious to use um how would I use this? Uh uh uh uh uh uh uh uh uh uh. Well, I would have to set up a new level app blah blah blah. Yeah, let's actually do that real quick. All right. So I want to use this on a real project. So one directory above this create a new project using well actually I have a lot of L13 project don't I? I do. Yeah. Where is that project? One moment. Can I test it in the test? Yeah, you can. Where do I have that? Uh uh uhuh. Streams. Oh, here we go. Okay. Can I use this? Yep, I can. All right. So, I'm going to just do this. Uh uh uh uh uh uh uh uh uh. So on this project, can you seam link? By the way, if you don't know, you can literally seam link a folder as a package on your Laval project. This is something that I typically use if I want to test things test things out. Okay. Can you seam link this framework so I can test this feature? All right. So what I think will end up happening is that we are going to see this framework being sim linked um over there. Yep, it's already reading the composer.json file and will now do the sim link situation which is good. Yep, it's done already apparently. So we're good to go I think. Yep, it is done actually. All right, one So I'm going to just add the LL framework the LL project into this framework project so I can have both at the same time. Uh how do I even do that? Uh can I can I actually do that? That's a good question. Can I have two project in the same PHPtorm view? It would be cool. New project from existing files. Nope. I want to just open a project here like oh attach to this window. Can I just attach? Oh, so nice nice. We back shed. Here we go. So we have the project right here which now should be sim linked. Yep, this is a sim link done. Good stuff. meaning that in theory I can now initiate a cloud code session here and work on it. All right. So I have just coded a new feature on the Lavel framework that allows me to do request image you know avatar or whatever and then optimize and then crop etc etc check and then I have to give it the file itself Check this file at framework level. Create very minimal and simple routes at web.php that allow me to test this. Here we go. Add to workspace. It was kind of similar. I just added like a recent project and that allowed me to um allow me to attach to an existing one. So that's what I've done. Livewire Ford Vess nursery v3. Uh I think both are fantastic. I love them both. Okay, what do we have here? So we have a very simple upload route with an upload in optimize and then we have a post upload and then we have a post. Yep. This is this is good. But I also need a way of seeing the image itself. So I'm going to just say that's that's looking good, but I need a way of seeing the new image somehow. Good stuff. Good point. The good point is now the new um You're absolutely All right. It's working on it. It's working on it. 80 people watching the live stream. You guys absolutely awesome, by the way. Absolutely awesome. Okay. Is this enough? Uh let me think a little bit. So we have the post avatar optimize it and stored in images publicly. Yes, is kind of enough. Feel like you should just have um la I don't know. You should just have at base level. Let's a base route like welcome page. Literally display the last uploaded Maybe call it avatar.png. The avatar.format. format and always upload to the same file name. Legal Dom, what's up, dude? How you doing? Should I go for my second Lakon US? 100%, dude. I will be there. I will be one of the speakers. I will be on one of the speakers and I'm very excited about that. If there's any of you is going to Lakon US or Laval Live Japan. All right. So we have one image which is nothing and then why is it doing this? Oh because we may it might be in various formats. Yeah, makes sense. And then we fetch the image and if the image exists we just have it and then we break it. Nice, nice, nice. And then we just display it. But I may also upload a new one right here. This is looking fantastic. And if I receive a post at root level, I'm going to just do whatever and then redirect back. This is looking good. Yes, sir. Just do it. I wish. Okay, I'm going, man. It will be fun. Storage link. Yes. Yes. Yes. You don't have to do tests, though. Do I need to say that? Maybe. Perhaps. Done. Okay. Well, if it's done, I can type composer dev. Uh, why is not working? Uh, oh, because I haven't run npm install perhaps. I think that's it. By the way, we haven't say thanks to our sponsors yet. We need to do that. Redberry International, one of the best digital agencies in the entire planet doing Laval and Vue.js. Check them out. Modern Email Delivery thanks to Mail Trap. They have this local email solution, but now they are production ready. Check them out. They are lovely, lovely, lovely. I'm using them from all my emails right now. Serpa API. So, basically, if you need like Google, but you want to have it like through an API format, that's what you would use Serpa API for. Okay, they're absolutely awesome. They have this very easy output in the API format that you may use. They support Google, they support Amazon, kind of the major search providers. Check them out. Jet Brains, of course, they have this beautiful PHP storm editor that I use all the time, but they also have now, you know, Jet Brains Air, which we're going to check it out maybe in the next live stream. Titan, of course, they build you in rescue apps for uh indev teams. Um, they obviously have wrote the book Laval up and running thanks to Matt Staler and they're obviously very good on what they do. So, check them out if you can. Titan.com, Redberry International, of course, uh, they're absolutely awesome as well. They do AI code reviews and you receive them through pull requests. They do like nice graphs like this. Um, I've used them and I use them in all my open source stuff at the minute. Check them out. Code rabbit.ai. Thank you. Thank you. Thank you. And by the way, I have a new video about Inertia V3 if you haven't checked it already. Okay, check it out. Check it out. Check it out. Check it out. New video about Inertia V3. Okay, it's it is awesome. Okay, it is awesome. So, this is all done and we back to the game. Uh, so I was trying to serve the image which wasn't yet done. Let's actually type here composerdev now. So, now it should work and it does. Meaning that I can just copy this. Go to a regular Safari browser. Bam. I see image test upload. Now I need to remove the image for a bit. So there's a thing which is I share my Safari window. But if I click on choose file which I just done right now. What end ups happening is that um it just shows all what I have on the finder which I don't want you guys to see because I have images you know I have all of my stuff. So anyways I'm going to just find a good image of myself and we use that image all the time. Okay. So, let's use this beautiful image of myself. Call it profile full. Yep. Yep. Yep. So, I have I'm going to upload an image of my face, basically. Okay. So, I'm going to say upload. And done it. I'm going to go back and now what we have is we have the image uploaded here. I'm going to click on upload. And we have a runtime exception. This is good. Okay. Runtime exception is saying the following. Image intervention is required to use a GD driver. You may require through composer. So, this is lovely. Exactly what we want. Okay, exactly what we want. So we go back, we go to the terminal and we just cancel this. We type composer require intervention image 3.0. So it will now require the package. All of this is expected. Okay, we clear the terminal. We type composer dev and we just go back to the game. Okay, we just go back to the game. Same stuff. Easy peasy. Let's upload the game. Same the same Yep, this one. And now we just click on upload. Uploaded. Even though this is not being well displayed, something is wrong here. Local storage. Oh, the URL is not okay. I can fix this. So on the M file, this is not correct. And actually, if I refresh it, it should just work. Here we go. Nice. And I think this actually worked meaning that um the images doesn't have even close to the same quality. And now is a webp image. So I have uploaded a PNG. Let me just double check the dimensions and also like the size itself uh uh let me see. So profile full the profile full image I have uploaded is a PNG and it has one.5 megabytes. So it's a huge image. Okay, huge image. Now the image we are visualizing here if I were to open it in a very in a different tab as you guys can see first of all is a webp image and it doesn't have even the same quality. And if I were to, let me just try to save this image in downloads and see how much are we talking about. 3 kilobytes. This is so good. 3 kilobytes shed. Basically, this image that was a [ __ ] 1.5 size image used for avatar. It's now one 3 kilobytes only. That's how much webp gives you in terms of speed per like literally, you know. Oh my god. So good. This is exactly what we want. Uh let me just go here to resources uh routes webp and what we have done. Let me just confirm. Request image avatar corp to 200 to 200 optimized to webp quality 80%. This is very good stuff. This is exactly what I wanted. What product is this? Well, welcome to the live stream. My name is Nuno. I'm a PHP Laravel developer and today we are developing a new feature for the Lavel framework. I'm a Lavel core team member. So good stuff. So Maria is saying the following webp is little brother of web M which is insane better than MP4. Oh really? And AV is even smaller. I don't know those two formats. I'm going to be honest with you. Well I know MP4 but I don't know what is web M. Webp is like dope though, you know. So optimize it. Allow me to specify the format. I have a few questions. What happens if I call optimize without nothing will be webp by default and there is no quality by default which which I don't know I'm going to give like 80% quality by default just like Okay, 80 80% quality by default. Let me think if I want this. I think I want this. Yes, 80% quality by default. And then I go back here and I want to I want us to just call optimize without any arguments. And I don't want I don't want to warp the image. I'm going to just leave it open. I the only thing I want to do is optimize. Okay. So, if I do this and I go back to the base URL, I can just go again and upload the same image. Let's actually do that. All right. Same image profile, full picture, 1.5 megabytes. So, that's done. And now I'm going to click on upload. This should give me a much better picture. And here we go. Uh, let me just refresh this. So, we have a much better picture right here. However, if I inspect the element and I open it, I see the image right here. I can save it. Let me just save it and show you the size. I save it into downloads. And the size is 56 kilobytes. Okay. So, one image got ported from PNG to WEBP. And now it's 56 kilobytes only. And the same quality like visually it's the same quality. Feels the same quality. Good stuff. Honestly, very happy about this. The quality should be 80p. The 8 80 like why 80 not 90. Raki saying the following. I know you buddy. I met you at Lacon uh 2026. That was such a good Lakon man. I had such a good time. This is cool. I agree dude. I'm very happy about the results so far. All right, what do we have uh more to do here? Let's actually we need to review the entire code obviously test all of this [ __ ] That's important. We can we can change drivers. Of course, we have imageic as well. If I were to use right now, would that even work? That's a good question. So, if I were to go here and we type something like useic, would that even work? That's That's a good question, right? I don't even know. We're about to find out. So, I'm going to upload. Same image. Well, it just worked. Same stuff. Interesting. I'm curious to see how different the image actually is. It's one more kilobyte. That's very interesting. So using GD it's 56 kilobytes. Using Imagic is 57 kilobytes. Literally one kilobyte difference in terms of quality. Visually they look as good as the original one. Like literally no differences. Crop is resizing, not cropping. No, cropping is cropping. Okay. It will basically just like compact the image if I'm honest. Did you add an enum support for all those methods? Not an enum. It was more like um just methods basically regular methods. Okay. By the way, Shad, if you're having fun today, don't forget, go all the way down, click like on this video. Insanely important. If you are on Twitch, make sure you also do that on my YouTube channel. Uh click a like on this video, subscribe to the channel, do all that stuff. Okay? If you do that, this number will go up. Okay? If one of you who is not subscriber yet clicks on subscribe, this number will go up. Does it remove the image metadata as well? I have no idea yet. I will have an idea in the future, but no idea yet. I'm still like prototyping this [ __ ] you know. That's the first thing you guys should do when you guys are coding something is just making sure you can actually do it and then I just go line by line actually individually asset that everything is just perfect. Okay. All right. This is looking fantastic. so we have this process which will will make sure we don't process the same thing twice. I was wondering I'm wondering like what happens if some of you were saying like I want to just do it twice like image optimize store as blah blah blah and then I want to do it again. In theory, something we could do if you guys want to is that we could do something like this. So, for those of you who are saying that you guys want to have like two images at the same time, in theory, I could potentially do something like this. I could do um let's say uh corp like 100 and 100 store that we could just do this request image blah blah blah blah and then with that image corp it as 100 100 and then store it as that and then with uh with the same image just do 200 200 and store it as that. The problem with this approach is that I would have to find a way of storing the backup image basically or keeping the backup image which I can maybe do it honestly like I I could preserve the original image some somehow somewhere you know that crop actually feels like a resize is not the same. Well, let me see. You know, that's a concern of an underlying library. So, let me just double check what the corp is doing. Oh, it's a cover. Oh, I meant Oh, [ __ ] All right, let's fix it. Seems that uh our crop is or should be or uh should be covered instead. Can you fix it? All right then. All right. It's making it's making sure of that. Okay. Um I want to quickly double check one little thing. Um so this is expected. This is expected. I think you can do some job here of formatting real quick. So here I want to import this uh uh uh uh uh there's already an uploaded file. Oh yeah, it's the same. Like what the [ __ ] So this could be like that. And how about the image upload? This can be fully imported, correct? Yes. And this one can be fully imported as well, I think. Yes. And uh here I'm going to use the container directly. Look at me actually doing some code. Feels good. Image mail file system. And here we import the file system the container actually. Bam. Good stuff. Non-static call. Should it? Oh, isn't this make? Oh, get instance make. Sorry. All right. All right. Good stuff. Why do you code by yourself? I feel you, man. If the user selects a 10 megabytes image, uh, it has to be uploaded first in that case. Yeah, it gets uploaded to the temporary directory. That's the way it works. Any file upload works like that. It goes always to a temporary directory. G go ahead thank you so much for the subscription um tier one dude you are two months already subscriber I appreciate your support dude you are absolutely awesome thank you thank you thank you what's the difference of using container there or versus the app uh so basically this is this is an illuminate component and the app function relies on the foundation meaning that if this component were to be used individually like in lavl zero the app function wouldn't be available so you kind of have to rely directly on the container itself actually by doing this I should technically make sure the container is registered at technically I know it is but if I if I were to go to this HTTP thing I need to make sure oh where is the comp Oh right here I need to make sure the container is here which is not which is a good point if it's not let me just double check if uh container is being used somewhere on the HTTP layer I'm like a thousand% % sure it is though like I would be very surprised if it's not even though this is used where this is used if I type like container I don't see it anywhere okay how about laval hap like just slapp I don't see it either how about request do I see this yep I see this which does retrieve item Mhm. Well, I will do a to-do here and I will check this off stream. To-do check if uh it's fine to use container. If it's not fine, I can potentially do this app because I'm at the request layer, I think, level. And that must have a way of accessing the current app like a,000%. Container app. Yeah, I mean 100% somewhere. So, I will leave a to-do anyways to double check it. Okay. But I'm like positive that this is fine. Yep. Yep. Yep. So, this receives file system and file uploaded. And then Yeah. This is good stuff. Yep. Yep. Yep. Yep. Yep. Yep. Yep. What is this? And why do we need this this way? Oh, because the driver is resolved like later on later on the game basically. And also I can change the driver if I want to. And the res driver is resolved when we are going to actually encode stuff. Yep. Yep. Yep. Yep. Yep. Yep. Now there is something to be said about the given file uploaded because I almost feel that if we want something like this to happen, this corp right here will happen like on this image already, which is kind of [ __ ] up. I may have to think about this a little bit. Pro TV is saying the following for uploads. Does Laval handle all the security stuff like all kinds of uploaded data? Um, on that case you would have to uh validate the uploaded data which you can do from a form request. I think the next package should be for inertia to optimize the image client side before upload. That's a good point actually like a JavaScript optimized image. That's a good point. Aren't those annotations superfluous? Maybe. Which annotations are you talking about? Oh, on the interact with data thing with input. Yeah, they are. But the thing is that the current file right now it's like using that kind of legacy. Let's call it that way. So I kind of want to preserve the file in the same style all the time with new stuff like with new files for example. So here is all good Here is like fully typed and without any uh PHP docs. How much of your work contains AI assistant development? I would say 90 80 90% at the minute. Yep. Yep. Yep. Yep. And 100% sure GS can optimize the image before the upload. Yeah, that's a good idea actually. All right, what do we have? Uh, we have a very decent foundation already, honestly. a very decent foundation. I really feel now it's the time to actually have a good test suite around this. So then we can just refactor things if we have to. What do we have here? Do we have any kind of very good integration testing? Let me see. We have very bad tests like none of them. Oh, they do actually make panning image. So this is where I want to test things out. I also want to make sure one little thing. If I do on the very end when I actually replace the uploaded image, should it be replaced to begin with? That's a very good question. Like right here, once we optimize the image, we are basically overwriting the original one that got uploaded. Now, is this a good thing to do that we we are we still need to figure it out, right? We still need to figure it out because one question would be uh uh uh uh Yeah, one question. I mean, I can see this breaking already. Like I have um let's say a nuno.png for example, and I'm going to replace a webp and this will nuno.png. So that's a a broken example already, right? Which also leads to the question like if I do dd here this file get real path what do I get exactly? Oh, I don't even get an extension in anything like that. That's interesting. Huh. So which also leads to the question if I do this file get extension do I have anything like that? Yep. Yep. Yep. If I do this after optimizing it what do I get? I get no extension whatsoever. Well that's interesting. How about if I comment this? I get no extension whatsoever. That's all. All right. Is that broken client original extension? Okay, let's actually use this one. So, if I refresh this, I will get PNG. If I replace this, I get PNG H. almost feels like here I should just create a new file so I don't have this issue I should do something like this this file equals to file you know what I mean or just do this instead like this will be kept you know and I can just do this if if there is no changes or the file was already process it no I cannot do it this way Yeah, I'm going to ask Cloud Code. I want to see how Cloudflow thinks about this. All right. One thing I just noticed is currently on the dash call we override the actual uploaded file. So, two questions here. Is this actually okay? If not, well, if not, why not? But also, doesn't this literally bugs things like get uh you know methods on the file uploaded class cuz it my think is still the same file. I'm going to change to plan mode to see what it says about this. Never mess with the original. Leave it leave it at the temp. Always save it and override the new storage image. Delet the temporary the end. Well, the the temporary well the temporary file will always be deleted. You know, you don't have to actually delete it yourself. But Andre is saying the following. Laravel, the temporary uploaded file in the original file name um lives in a separate file, separate life. Oh, you born your tokens already. Oh, no. That's horrible, dude. How can you talk and code at the same time? That's the way I work.…

Transcript truncated. Watch the full video for the complete content.

Get daily recaps from
nunomaduro

AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.