در حال بارگذاری ...

Introducing Blade Commons0:00

DEBUGGING Another sparsity package that I'd like to show you is really, really small, but has a big impact for debugging. And it's called Laravel Blade Commons. This is the repository of Laravel Blade Commons. Let's see, the title says, Add debug comments to your rendered output. So you can already tell that this is more for debugging. And let's take a look at one of those images here. So, yeah, in the output, in your HTML source,

Package Output Overview0:25

And let's take a look at one of those images here. So, yeah, in the output, in your HTML source, you will see that here are some comments around your Blade components. And that's already it, that's already it, what this package does. Let's take a look. How do we install it? Here we go. Let's bring this package in. Let's see, is there anything else we need to do? There is a config file.

Installation and Configuration0:52

Let's see, is there anything else we need to do? There is a config file. You can also take a look here. We're going to enable the package when APP_DEBUG is true, so only for debugging, which is good. There are some specific Commenter classes that you can include. You can also create your own ones if you want to, but this would not be the definition of small, easy-to-install package. Yeah, there's some other stuff that we can do, but let's take a look at how this works.

Testing in Application1:19

Yeah, there's some other stuff that we can do, but let's take a look at how this works. We just bring in the config as well, and I think then we can already try this out. So we're going to take a look at our test application, and I think we're going to use the form, which we have already worked with. All right, so what does this look like now in the HTML? Let's open up another source code, and let's take a look. And you can already see here at the top, we have some new information.

Let's open up another source code, and let's take a look. And you can already see here at the top, we have some new information. So we can see which view we are currently seeing here on this page. We can see the route with the controller, and we can see that we're starting here a new component, which is AppLayout, and that is correct. And how cool is this? When being on a website like this, you can make sure that you see exactly which layout is being used, which view are currently taking a look,

you can make sure that you see exactly which layout is being used, which few are currently taking a look, especially on big application, it can become quite strange to find what you're currently looking at. So I think this is a really cool package idea. Let's also take a look, for example, at this content. And we can see here that we have label. So here we start the component, which is the form's label component from Blade to iKit. Here we're starting it, here we're ending it.

which is the form's label component from Play to iKit. Here we're starting it, here we're ending it. Here we have those error components, or this error component for this input field, which currently we have nothing in between because we don't show an error. But here you would see the component if there was a validation error. And basically, that's it. And this is already what this package does. Yeah, that's it. It shows you some information about the page, like the few, the route, controller, and layout maybe,

Key Takeaways2:59

Yeah, that's it. It shows you some information about the page, like the few, the route, controller, and layout maybe, and then also where AppLayout components start and where it ends. Because if you go to this page and you want to change something and you're not sure where this specific HTML is being placed, this package will tell you. Let's break down what we just learned. Whenever you make use of a lot of components in your view files, it's a good idea to install Laravel Blade comments so that it's easier for you to debugging.

it's a good idea to install Blade comments so that it's easier for you to debugging and to make sure you're finding the right HTML code by looking at the source code. Thank you. Spassi.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟