Тёмный
Program With Gio
Program With Gio
Program With Gio
Подписаться
Hello & welcome to my channel!

I've been coding for over a decade & my very first website was built with HTML, CSS, & PHP all in a single index.php file (good old times). I decided to make my own channel and start producing content on things that I know & have learned over the years as well as the things that I will learn along the way. Currently, my main stack consists of PHP, Laravel, GraphQL, React JS (Next.js) & Tailwind CSS. (Though, I am planning on exploring other tech)

Happy coding!

X/Twitter - x.com/giodev8
LinkedIn - www.linkedin.com/in/giodev8
Discord - DM me on X for the invite
Patreon - www.patreon.com/programwithgio
Are tests really that bad?
4:32
Год назад
Комментарии
@mhballa5866
@mhballa5866 День назад
Gio , I have problem when I follow everything work until i reach at 7:50 created the View class but when i refresh the browser i get : Fatal error: Uncaught Error: Class "App\Controllers\View" not found in /var/www/app/Controllers/HomeController.php:10 Stack trace: #0 [internal function]: App\Controllers\HomeController->index() #1 /var/www/app/Router.php(55): call_user_func_array(Array, Array) #2 /var/www/public/index.php(25): App\Router->resolve('/', 'get') #3 {main} thrown in /var/www/app/Controllers/HomeController.php on line 10 i didn't get the error, I made the class in the app directory , everything was working until now and i don't know what is wrong?
@fermevc
@fermevc День назад
Sorry to bother you, but if you see this message and you find some spare time, please write a few words about the following: When we customize "ResetPassword::createUrlUsing()" in a way that link in notification email points to "frontend domain" instead of "backend", is it posible to check URL validity (expiration time)?
@HakanGalip
@HakanGalip День назад
Thank's a lo very good and understandable...
@techatival
@techatival День назад
Thanks Gio!
@lairotuT-Tutorial
@lairotuT-Tutorial 2 дня назад
I have a question that is indeed a bit to understand the key value of frameworks and dependency packages. In these I more often find self() instead of the static() that you mention and I understand the difference but guess it might be the same in this case to use the one or the other. In many above constallations the result is: class A { public function adapter() { $instance = B::create(); } class B { public static function create() { return C::create(new self()); } class C { public function __construct($value) { $this->value = $value; } public static function create($value):self { return new self($value); } For me this is confusing and not readable. I guess the result is that I have $instance that is an object of class C and has access to the object of class B through $instance-value. Am I right? Why that complicated?? For me object orientation is to get more clearity to the code but in a framework and similar it for me only results in mad code chaos. I understand what the method of A shall do but it runs through two other classes that have nothing to do with it to achieve it. I simply don't understand why I should include such a mess into my code. Could you please tell me: If I really understand what the framework/package does, do you think it is still better to rely on the framework/package or is it better to use my own code that simply returns the exactly same result but more readable and/or faster with less extra loops? I more and more come to the point that it only makes sense to use a framework if you ignore what it does in the background and just rely on the results it offers. For me I would always want to either to understand all the third party code or varify every result coming from that code. I guess that is no effective coding....
@binaryfire
@binaryfire 2 дня назад
Great videos. One point - the volume varies a lot from video to video. You should put a compressor on the audio track in your video editing software - that'll level out the audio levels and make them more consistent across all your vids.
@nabingiri2529
@nabingiri2529 2 дня назад
Keep going I will watch it when i will be free
@ycea357
@ycea357 3 дня назад
I would like to use docker. But on windows it works too slow. I've got problems with installation already. It downloads very slow. So thank you for advicing laragon
@Silent_tuts
@Silent_tuts 3 дня назад
<?php $color = $transaction['amount'] < 0 ? 'red' : ($transaction['amount'] > 0 ? 'green' : ''); ?> <td style="color: <?= $color; ?>;"><?= formatDollarAmount($transaction['amount']); ?></td> amount color formatting with ternary operators.
@parijke
@parijke 3 дня назад
Hi Gio, do I understand correctly that instead of enum->value you could provide an enum and the ternary will accept as well cause it is an instance of $backedEnumClass?
@ahmad-murery
@ahmad-murery 3 дня назад
It's definitely helpful. Thanks Gio!
@MahmoudReyad
@MahmoudReyad 3 дня назад
@md.omarfaruk2893
@md.omarfaruk2893 3 дня назад
Great videos. Thank you
@Silent_tuts
@Silent_tuts 4 дня назад
I hope you’re doing well! I really enjoy your content, especially the PHP & Laravel series. I believe a series on WordPress core development, focusing on plugins and theme development, would be incredibly valuable. Your expertise would provide great insights for many of us looking to enhance our skills.
@dexterprabin
@dexterprabin 4 дня назад
How can I setup my Phpstrom IDE for declaring strict type 4:06
@aerohcss
@aerohcss 5 дней назад
Gio, could you pls say what I'm doing wrong with testing setting class in container? #[Test] public function testItSet() { $users = new class () { public function index(): array { return [1, 2, 3]; } }; $this->container->set('test', $users::class); $this->assertSame($users::class, $this->container->get('test')); } 1) tests\Unit\ContainerTest::testItSet Failed asserting that class@anonymous /var/www/tests/Unit/ContainerTest.php:40$d9 Object #296 () is identical to Binary String: 0x636c61737340616e6f6e796d6f7573002f7661722f7777772f74657374732f556e69742f436f6e7461696e6572546573742e7068703a3430246439. /var/www/tests/Unit/ContainerTest.php:47
@Omor_Faruk_Sheikh_Raihan
@Omor_Faruk_Sheikh_Raihan 5 дней назад
❤❤❤
@rajcodes
@rajcodes 6 дней назад
do u have any community to join i am new to laravel
@ograda3120
@ograda3120 6 дней назад
I was initially (some many years ago) put off by Symfony and Doctrine because I dislike annotiations, I just can't stand looking at them... Native PHP attributes change everything. It looks beautiful. As my projects got complex, so I was looking for a more DDD approach with proper SoC, but was fighting with Laravel to get it right, it finally clicked why Data Mapper is preferred over Active Record. And here I am. My good sir you have a knack for explaining things; Do you think you can make or recommend a video or a resource that breaks down proper DDD planning in terms of aggregates, entities, value objects, preferably for someone from Active Record background switching over to Data Mapping?
@alexb.1423
@alexb.1423 6 дней назад
I love when you say "but let's keep it simple" and there are over 7 php files and hundreds of rows of code 😇😆😆 I suppose that will be clearer for me once I have fully check the Laravel lessons. I like how you show a few different ways for something, even though I'm a little bit confused sometimes. Thanks again and we keep going!
@mustafaelfituri9531
@mustafaelfituri9531 7 дней назад
Hey Gio, Thanks for the course Will you be making a laravel web application
@JailadinShaik8897
@JailadinShaik8897 7 дней назад
so exciting on diving into Laravel like this. nowhere found this level clear and detail explanation
@kekw5738
@kekw5738 7 дней назад
💙💙💙
@rubelahmed8000
@rubelahmed8000 7 дней назад
Can I know about API , REST API from your PHP course?
@zorro161
@zorro161 7 дней назад
I have a year experience working with PHP I am here to deepen my knowledge and I can tell you your course will help me do just that man thanks 🙏
@basirxujamuradov8704
@basirxujamuradov8704 8 дней назад
Thank you for your time and efforts to make these amazing videos ! Have you got plans to make videos about a bit more advanced things like rabbitmq, kafka, grpc, static analizers or maybe "learn symfony the right way"?)
@aerohcss
@aerohcss 8 дней назад
Gio, I'm a bit confused about concepts. Am I right that general name for all fake classes are Mock objects that in turn can have fixed output ("to stub") or do output via expectations ("to mock")?
@PeterGeorgiev-w2x
@PeterGeorgiev-w2x 8 дней назад
Great video, thanks!
@Nukker13
@Nukker13 8 дней назад
For some reason, I get stuck on 8:33 part of the video, when the router is optimized to work with arrays. Any idea what could be fixed? It just throws the same routes error that is created earlier in this lesson, no idea why the URIs are not cathed properly.
@ProgramWithGio
@ProgramWithGio 8 дней назад
I'd have to look at your code to help you
@Nukker13
@Nukker13 8 дней назад
@@ProgramWithGio is it possible to contact you? I saw you mentioned Twitter DMs, but I'm not sure if you're responding to such questions
@ProgramWithGio
@ProgramWithGio 8 дней назад
Twitter is the best way. I do respond it when I have free time
9 дней назад
This channel is DOPE and the course too! (y)
@ProgramWithGio
@ProgramWithGio 8 дней назад
Thank you 💙
@lairotuT-Tutorial
@lairotuT-Tutorial 9 дней назад
I have to be honest. I skipped this video in first instance as I do not use MySQL and as I am already used to SQL in several variants and dialects for quite a long time. Indeed this is the first of your tutorials where I did not learn anything new. BUT It was once again a pleasure to just watch, see and hear you putting together all these really hard topics, explain all important things and make me wonder why I needed so much time to get this knowledge in the past. Great work! Maybe one small tweak to mention: You explain Safe Update Mode and I appreciate this as not only many beginners but even big companies do not use it. Why not showing your audience where and how to activate it? Would you give me your opinion on one thing: I personally prefer SQLServer/TSQL/SSMS and like Oracle as well (I have no real reason but it imo comes more handy when you want the DB-Server to do the things on its own instead of your app/web server). It's really seldom that I see people talking or working with TSQL in combination to PHP. Are there really actual reasons maybe limits with this combination? Or do you think it might just be because of older versions that did not match/had conflicts?
@lairotuT-Tutorial
@lairotuT-Tutorial 9 дней назад
I don't remember... did I mention how great you are? 🙂
@ProgramWithGio
@ProgramWithGio 8 дней назад
💙💙💙
@lairotuT-Tutorial
@lairotuT-Tutorial 9 дней назад
Switching back and forth inside your videos while understanding PHP more and more I remembered your mention at 4:58 "The use of static methods and properties is generally considered a bad practice" Now Laravel has these Facades - that as far as I understand - enable us to simply have a static counterpart of every of our classes/objects. Would be great if you could explain why this is a really good usecase. I guess there might be a new video on Facades in your laravel course? btw.: I have not mentioned by now that also this video is great 🙂
@ProgramWithGio
@ProgramWithGio 9 дней назад
I have a video on Facades that will be released a bit later that explains this exact thing. Facades are not same as static methods, in fact, facades dont define static methods. It just proxies the call to the actual object that defines the method (which is non static). It is just a PHP's call static magic method implementation
@lairotuT-Tutorial
@lairotuT-Tutorial 8 дней назад
@@ProgramWithGio I look forward to that video 😁
@lairotuT-Tutorial
@lairotuT-Tutorial День назад
@@ProgramWithGio @8:00 you mention that we will talk about singleton pattern in more detail later in this course. Similar to what I said about Facades I would like to understand a bit more about singletons as I see that these are really used a lot and I would like to see if I should or should not refactor all these to DI in my own project instead of just taking what others built out of masses of singletons. One example for this is the dotenv you include in PDO part 2 later on. As far as I can see by including this to my project I include 13 singleton classes plus many singletons from the dependecies of this 'module'. Once again I am not confident that it is overall bad practice in such a case but I would like to be able to understand it similar to the Facades matter. Can you tell me if there is a later video in this course that I possibly have missed that covers singletons a bit deeper?
@lairotuT-Tutorial
@lairotuT-Tutorial 9 дней назад
Wow, the least part with the cached routes blew my mind. Where I was clearly understanding how composer caches the autoloading in a simple array with key/value pairs, I wonder how such a deep array tree can really speed up the routing. Can you explain or even show how laravel reads from this "array monster" efficiently? I must have missed that in your PHP series but I would possibly end up in a "if/else monster" to bring the routes to action I guess... There must be a really quick soloution, right?
@ProgramWithGio
@ProgramWithGio 9 дней назад
If you open the cached routes file you will see its not just a giant array, it sets compiled routes on the router instance. Then uses that compiled routes to find the appropriate route.
@lairotuT-Tutorial
@lairotuT-Tutorial 9 дней назад
Hey Gio, once again a terrific example of your teaching strength! massive content brought to comprehensive words! Thank you soo much! This will for sure be a video that I will review from time to time whenever I will retry to understand what laravel routes work like.
@ProgramWithGio
@ProgramWithGio 8 дней назад
Thank you 💙💙
@MahmoudReyad
@MahmoudReyad 9 дней назад
@ProgramWithGio
@ProgramWithGio 8 дней назад
💙
@joshuasabac2389
@joshuasabac2389 9 дней назад
💗💗💗
@ProgramWithGio
@ProgramWithGio 8 дней назад
💙💙
@lairotuT-Tutorial
@lairotuT-Tutorial 9 дней назад
Gio can you maybe explain to me why, when I pass an array through the params in the way you explain it, inside the view empty($this->array) - same for other options you show - returns true even if empty($this->array[0]) returns false? The array is not set but can be accessed without problems and the array's content is set. I guess it is something related to ob_get_clean() or to the __get() method but I can't figure out, where it really switches. Inside the View class empty($params['array']) returns false.
@ProgramWithGio
@ProgramWithGio 8 дней назад
try var_dump($this->array) and see what you get
@lairotuT-Tutorial
@lairotuT-Tutorial 8 дней назад
@@ProgramWithGio var_dump(this->array) gives the complete array with 75 elements. That is what I meant with „can be accessed without problems“
@Neon8402
@Neon8402 9 дней назад
for anyone can not resolve the error at the end of the video, just go to your .env and change the SESSION_DRIVER=file
@ProgramWithGio
@ProgramWithGio 8 дней назад
Or run php artisan migrate. I believe I mentioned that at 6:30
@Neon8402
@Neon8402 8 дней назад
@@ProgramWithGio agree, however in my case I have to run php artisan make:session-table first, so I just change the SESSION_DRIVER
@jeucasulo
@jeucasulo 10 дней назад
what is this editor name?
@ProgramWithGio
@ProgramWithGio 10 дней назад
Phpstorm
@jeucasulo
@jeucasulo 9 дней назад
@@ProgramWithGio thanks, your tutorials are really good btw, im finishing a tutorial about apache and going tô come back to your PHP tutorial. Always something New tô learn
@lairotuT-Tutorial
@lairotuT-Tutorial 10 дней назад
hey Gio, I watched this lesson maybe 5-6 times now. Not because it is hard to understand. I already have used the MVC pattern and heard about it in numerous variants. I really apreciate that you not only teach how to implement your picture of it but that you give us your ideas about it. There are weird variants out there (my first contact was someone teaching to creat Controllers as child class of the Model and Views as child class of the Controller for me that lacked the logic of general object oriented programming. You enable me to think further and in a way create my own "style" / to decide what pattern and what logic fits best to my thinking. Thank you sooo much! In regards to validation I would like to hear your idea about my thoughts: I think as you mentioned that validation that ensures that there is no wrong/useless content or that shall result in direct response to the user for correction, should be an extra layer on the controller side. But there are similar "validations" that I call different: - normalization - If incoming feed has to be formatted / transferred into a form that fits to the internal usage inside the app. This shall in my opinion ba a layer of the model so that the controller sends the raw data to the model side, the normalizer returns the correct form and the controller might go on to work with the data or the normalizer goes on on model side to store the data in correct form. Example: validation that internally transfers all times to one timezone to enable comparison, formatting all floats to integer due to more reliable calculation... - escalation - this term is not perfect, maybe you find a better. For me this is the validation that is close to the error handling. In short every validation that indicates that the app might be used incorrectly, internal procedures might be harmed or critical situations must be avoided - should be an extra layer of the error handling and as part of this, part of the model / business logic. Reason for this in my opinion is that my code shall not only ensure the correct form/disable the unwanted features but might got farward and identify the source of the bad data, set up a monitoring to enable risk analysis. Example: HTML special characters handling, request timeouts, file validation of correct type/content relation...
@ProgramWithGio
@ProgramWithGio 8 дней назад
You can have as many layers as needed as long as you dont overcomplicate/overengineer stuff. Formatting can happen in its own layer, can happen in a service class or can happen in controller as well & model can receive a DTO or already normalized/formatted data. Many different approaches. As long as you are not bloating either side, you should be ok. I personally would take the extra layer approach to avoid bloating controllers
@AsifIqbal-lz6ly
@AsifIqbal-lz6ly 10 дней назад
I have a question that this experession $x = floor((0.1+0.7)*10); evaluates to 7 but when I remove floor function then it evaluates to 8. If 0.1 and 0.7 does not have accurate binary representation then it should calculate to 7 without floor also but it evaluates to correct value 8. Why it is happening? Can you please clear me?
@ProgramWithGio
@ProgramWithGio 8 дней назад
Floor rounds it down, the actual number is very close to 8 so if you dont apply floor then PHP just rounds it up to 8 cause the number it evaluates to is something like 7.999... I mentioned that at 2:20
@abduabdu7404
@abduabdu7404 10 дней назад
Hello Gio, in the examples of using the call() method why didn't you use the splat operator and instead used call_user_func_array(), is there any advanced reason for that, like a better performance from call_user_func_array()?
@ProgramWithGio
@ProgramWithGio 8 дней назад
Probably an old habit. Yes the splat operator would work as well & is actually probably faster than using the call_user_func_array
@abduabdu7404
@abduabdu7404 5 дней назад
@@ProgramWithGio Thank you for your response, its not only the course that is great but also you as a person for not being arrogant and helping others learn what is best to learn and updating the course two years later❤
@goldfix8112
@goldfix8112 11 дней назад
I started watching and learning from your videos in this playlist about 1-1.5 months ago. Some topics in some videos were very difficult for me to understand and remember. However, this quick overview of Composition vs Inheritance was one of the videos that I found really helpful and easy to understand. Thank you!!
@ProgramWithGio
@ProgramWithGio 10 дней назад
Glad you like them! Thank you 🙌
@michaelplichart3224
@michaelplichart3224 11 дней назад
Another excellent video, very informative. Thank you so much
@ProgramWithGio
@ProgramWithGio 10 дней назад
Glad it was helpful, thank you 🙌
@nikitazxc1040
@nikitazxc1040 11 дней назад
I just wanted to say, that I found this course in 2022, and its really brilliant in world of Php courses. After completing this course I easily found a job, where I developed my skills more and more. I want to thank the author of this course. You did a great job, now I’m getting close to 2 years as Php developer. Wish you all the best, bro
@ProgramWithGio
@ProgramWithGio 11 дней назад
That's awesome, thank you so much 🙏💙
@Silent_tuts
@Silent_tuts 11 дней назад
Can we use declare(strict_types=1) while developing custom WordPress plugins or Themes?
@ProgramWithGio
@ProgramWithGio 10 дней назад
I'm not sure, probably. But I'd be cautious using that in WordPress
@ChandanSomani-r5o
@ChandanSomani-r5o 11 дней назад
Loved the way you showed the way to configure docker & php ... just clear the missing information
@ProgramWithGio
@ProgramWithGio 10 дней назад
👍👍
@gideonvisbeen369
@gideonvisbeen369 11 дней назад
Hee Gio, silly question. Isn't it counter making a tight coupling to the entities with the service architecture? (If later on you want to distribute the service to grpc or api) (Although it works beautifully and fits inversion of control)
@ProgramWithGio
@ProgramWithGio 10 дней назад
Hey, yes but in 95% of apps you won't switch underlying architecture. For that you'd implement repository pattern probably
@hajiomary4913
@hajiomary4913 11 дней назад
How do you manage to return invoice status enum as string because I dont see any formatting section in your code because In laravel eloquent I see you use map method with a closure getArrayResult and select you put i alias which return hydrated entity
@ProgramWithGio
@ProgramWithGio 8 дней назад
Can you specify at which time in the video you are referring to?
@hajiomary4913
@hajiomary4913 8 дней назад
@@ProgramWithGio 6:03 what I ask how to format in order to get status as a string because I get error saying twig can't convert InvoiceStatus to string
@ProgramWithGio
@ProgramWithGio 8 дней назад
I don't see any status enum at 6:03, are you sure you are commenting on the right video?
@hajiomary4913
@hajiomary4913 8 дней назад
What I am trying to say is that how to print status enum when I need it.
@ProgramWithGio
@ProgramWithGio 8 дней назад
->value on enum object. That's why I asked you if you could refer to specific part in the video I could provide better direction, 6:03 you referred doesn't show invoice status so I got confused.