🔥 12 Essential VS Code Extensions for PHP & Laravel Development

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello developers welcome back to our channel in our last video we have explored some awesome vs code extensions for front end developers today we are switching our gears and in this video I'll show you some fantastic PHP and laravel extensions within vs code these extensions are like your coding companion making your PHP and larable projects easier and more efficient but before we dive into that let me tell you about my ebook JavaScript a comprehensive guide from es 2015 to es 2023 which is a must have for any JavaScript developer the ebook provides in-depth coverage of es 2015 to es 2023 features and enhancements enabling you to write better and more efficient code by izing advancements like Arrow functions async await promises and more JavaScript features using clear explanations and real world examples the ebook makes it easy for you to graas even the most challenging concepts with ease moreover it includes practical tips and best practices for writing efficient and maintainable JavaScript code making it an invaluable resource for small personal projects and large scale applications the world of JavaScript moves fast and this ebook will keep you up to date with the latest Trend and developments whether you are an experienced JavaScript developer or just starting this ebook is an excellent resource to take your skill to the next level allowing you to write cleaner more efficient and more containable code so don't miss out grab your copy today and take your JavaScript skill to new [Music] [Music] heights so our first PHP extension is PHP intelligence this one it is a powerful Visual Studio code extension designed to supercharge your PHP development experience it provides a wide range of features that will streamline your development process for example it provides features like code completions for classes methods functions and variables real time error reporting and code analysis on mouseover instant access to functions and variable documentations and many other features let's install this NC it is installed now let's go to any PHP file let's say in the model user.php and here let's say we have a any method public function let's say method name is XY Z and it accepts int dollar number then do something now let's go to another PHP file let's say the controllers or let's say in this verify email controller and right here in this invoke method let's initialize dollar user is equal to new user now here you can see this extension has smartly suggested and app models user class and on press enter it has automatically imported that class now let's call Dollar user the method name XY Z you can see it has scanned the user model class and suggested the method XY Z and it has also suggested that it required variable integer number and on press enter let's pass 10 on over this method you can see this extension has provided the documentation for this method this extension also provides goto definition feature for example right click on this method in the context menu we have a option go to definition on click this it will take us to its definition similar like that it provides lots of features the PHP intelence extension is a must have for any PHP developer it is a easy to use and offers a number of benefits that can help you to improve your productivity now let's see our next extension our next extension is PHP class generator this one this extension helps you to rate PHP classes interfaces And Trades this can be a huge time saer especially if you are working on a large project with a lots of different classes let's install this and see so it is installed now let's create a any PHP class let's say in the app here we have a PHP file helper. PHP now to generate PHP class let's open the command menu so press controll shift p and here I will search for Generate PHP class this one the second option press enter and it has automatically generated class for us and also it has automatically inserted name space for it similarly we can also generate trades so control shift p and generate trade and press enter and now we have helper trade this PHP class generator extension is very useful it speed UPS your class creation and reduce errors now let's see our next extension so our next extension is PHP namespace resolver this one this namespace resolver extension is a valuable tool that simplifies the management of class name space for PHP Developers it streamlines the process of resolving name spaces managing use statements and keeping track of class Imports let's install this NC it is installed now let's go to uh newly created class helper. PHP let's suppose here we have a method public function and let's say function name is process let's suppose it requir that's a request dollar request parameter now we need to resolve this class so right click on this and in this context menu we have new Option import class let's click this and it has given us the list of classes related to request and we need this one let's click this and you can see it has automatically imported this class saving a lot of time and effort similarly it also provides a feature to expand classes in line for example let's remove this use statement and let's suppose we want to expand this request in line so right click and here in this context menu we have option expand class click this and this has provided the list of classes to choose from and let's click this one and it is spended in line this name space resolver extension is very useful and going to save a lot of time let's see the next extension our next extension is PHP doc blocker the first one as its name suggest this extension helps you to generate and complete PHP documentation for your PHP code let's install and see this it is installed now let's go to user.php and here we have XY Z method and to create doc block for this method type SL star star and press enter the extension has automatically generated doc block for this method specifying that it accepts integer number and returns void one of the great feature of this extension is its ability to auto complete PHP doc text for example let's suppose here I type at author and it has automatically suggested the PHP dog tag author and on press enter it has given the option to fill name and email address similarly let's say one more example so add copyright and now we get the smart suggestion of option copyright on press enter and it has inserted the possible value using PHP doc blocker extension can simplify code documentation and enhance code readability give it a try and see how it can benefit your PHP development workflow let's see our next extension our next extension is PHP CS fixer this one phpcs fixer is a tool that automatically formats your PHP code to meet coding standard standards this tool can help you write cleaner and more readable code which is always good thing I highly recommend this extension and have even created a dedicated video tutorial on how to set up and use PHP CS fixer in your PHP project you can find the link to the tutorial in the description below I strongly suggest checking it out our next extension is Lara extra intelligence this one this extension offers a wide range of features that can supercharge your laravel development it provides comprehensive autoc completion feature for laravel functions methods and classes scroll down you can see it provides Auto completions for various laravel features such as route views config validation rules and many more scroll down there are also GIF images demonstrating how it autoc completes for routes and their parameters views and variables configs and so on let's install this NC it is installed now let's go to routes and here we have oath. PHP rout now in this o route file you can see we have route name such as password request password email password reset password update verification notice and and more other routes now let's navigate to Blade file let's say in the home blade. PHP right here let's type in route and in the signal code you can see it has autoc completed the all route names available in the laravel application let's say I want to use password now you can see this extension provided smart autocomplete suggestions for the route names related to password on press enter here we have password confirm similarly let's try for config so config and then in single code this extension has smartly suggested all the configuration value for this project let's say we want to use app. name so this laravel extra intelligence extension is very useful for larel developers it can boost your productivity reduce errors and help you make the most of laravel's features so this is must have extension for laravel Developers now let's see our next extension our next extension is laravel model Snippets this one this extension provides a set of code Snippets that can help you quickly generate boiler plate code for eloquent models let's install this and see it is done now let's go to model user PHP and here to generate boiler plate code type model and this extension has suggested all the Snippets related to models let's suppose I want to insert a pens array so type colon colon AP and this will suggest the snippet code for append array so press enter and it has inserted the append array with this PHP talk similarly let's suppose we want to insert cost attribute then type model C and this will suggest the relevant snippit and then press enter now we have cars snippet and we can set these values according to our needs let's remove this now if we see this extension and scroll down here is the list of model Snippets it Prov provides this extension will save you a lot of time by generating model Snippets effortlessly now let's try next extension and search for laravel blade snippits this one as its name suggest this extension provides various snippits for laravel blade file and not only that it also provides blade syntax highlights support for for visual studio code before installing this extension let's navigate to let's say login. blade. PHP and here we have some blade syntax like add csrf and this add errors and this is the Syntax for if conditions but you can see their syntax are not highlighted now let's install this extension and see the difference it is installed now let's go back to login blade file and immediately you can notice the difference now these syntax are highlighted and you can notice here also it also provides blade syntax so let's see this also so to add blade syntax first type B colon and let's suppose we want to add if condition so if now you can see it has suggested the snippit for blade if condition this one press enter now it has added the blade if condition similarly let's say we want to add for each Loop so type B colon for each now and select this one for each block and press enter now it has added the for each loop on this extension page scroll down here it provides these features blade syntax highlights blade Snippets emit work for blade template and also blade formatting here we have list of Blade Snippets it provides so this extension is very useful and will save you a lot of time by generating blade snippits effortlessly now let's see our next extension let's search for laravel blade spacer this one this laravel blade spacer can save a lot of time by automatically adding spacing to your blade templating markers for example in the blade file let's say login blade. PHP and here on type double curly braces there is no space between them I had to add spaces manually like this this larel blade spacer extension will help you on this so let's install this and see is done now let's navigate to Blade file and let's add double curly brackets and immediately you can notice that it has automatically inserted a space between the braces it also works for start C brackets and double exclamation sign and automatically it has inserted the spaces this small feature can save you a lot of time especially if you are working with a lot of Blade files it is definitely worth checking out our next extension is laravel pain this one this extension is similar to phpcs fixer Lara pit is a tool that can format your PHP code to meet coding standards the main difference between PHP CS fixer Andel pint is that PHP CS fixer can be used for any PHP projects but the laravel pint is specifically designed for laravel projects to learn more about how to use laravel pint I have created a dedicated video tutorial you can find the link to this tutorial in the description I highly recommend giving it a watch let's see our next extension our next very useful extension is EnV this EnV extension enhances the readability of EnV files by providing syntax highlighting let's install this it is done installed now let's navigate to EnV file and here you can see how well highlighted presentation of all the values making it much easier to read it's definitely worth giving it uh try now let's close all of these and see our next extension next extension is the better PHP unit this one if you write PHP unit tests for your projects then the better PHP unit extension for vs code will be a valuable tool for you it can save you a lot of time let me show you how so let's navigate to test unit example test.php and this file we have very basic test so to run the test we need to open the terminal and run vendor bin PHP unit it will run all the test in the project if you want to run specific test you can use the dash dash filter option and then we can pass the test name in our case let's say we want to test this so let's copy this method name and is equal to paste it right here press enter the test will pass if everything is correct but this process can be time consuming and frustrating if you need to switch between your code editor and the command line frequently the better PHP unit extension helps solve this problem by allowing you to run your test directly from Visual Studio code it provides you with quick feedback on your code without needing to switch to command line let's install this CC it is done now let's navigate to our example test.php file and to run this test first we need to place our cursor in the method and open the command menu so control shift p and search for better PHP unit and we need to run this option better PHP unit run and press enter you can see it has executed this task the test name and it has executed vendor bin PHP unit in the projects directory I like to use keyword shortcuts to run the test first so so let's add the keyboard shortcut to do this let's open the command menu so control shift p and search for keyboard shortcuts the first option preferences open keyboard shortcuts and press enter and here search for better PHP unit and we want to set the keyboard shortcut for the first option PHP unit run so let's double click this and here you can set your preferred shortcut I like to use controll T and press enter it's done now let's go to example test first place our cursor inside the method and press the keyboard shortcut controll T and here we go it has executed this command and the test is passing to make sure let's set false and run this test again control t and here we go this test is failing so it is working if you like to write your test in the pest this better PHP unit also supports past so to verify this press control comma and here let's search for better PHP unit and this is the extension settings for better PHP unit and here we can see the binary file path for pest and this is the binary file path for PHP unit so how it works in the composer. Json in the dependencies it search for pest if it founds the pest then it is going to run vendor bin pest otherwise it will run vendor bin PHP unit we can also override this binary path option for example laral provides PHP Artisan test command to run these test so instead of running vendor bin PHP unit let's say we want to run PHP AR and test so click this gear icon and copy setting ID now because we want to set this for this project only so let's select the workspace and click this icon to open workspace settings. Json and in the codes let's paste this and set its value PHP Artisan test it's done now let's go back to example test.php first make sure our curs are inside the method and press control T and now you can see it has executed PHP Aron test with this better PHP unit you can save time and improve your productivity by staying in your code editor and running your test faster and more efficiently this is all in this video I hope you found this video informative and that you are excited to start using these extensions in your own projects if you enjoyed this video and found it helpful please give it a thumbs up and consider subscribing to our channel for more such tutorials if you have any questions or suggestions for future videos please leave a comment below thanks for watching and happy [Music] cing
Info
Channel: QiroLab
Views: 2,906
Rating: undefined out of 5
Keywords: Laravel Development, VS Code Extensions, PHP Development, Code Completion, Debugging, Laravel Artisan, Blade Templating, Code Formatting, Version Control, Collaboration, VS Code Setup, Laravel Productivity, PHP Code Efficiency, Visual Studio Code extensions, Visual Studio Code
Id: laDy58tOMV4
Channel Id: undefined
Length: 26min 20sec (1580 seconds)
Published: Sat Mar 16 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.