Base Component Traits0:00
Here's a class that you can find in the FilamentSupport package. It's part of the Filament ecosystem, which is a package that's required by every other package within Filament. This component class implements five traits. Three of those traits implement features that we've already discussed in this series. For example, the Configurable trait handles global configuration for all components within EvaluatesClosures trait is able to call functions and inject utilities into them. The Macroable trait, similar to the one included in Laravel, is able to handle registering dynamic functions. And there are two other core Laravel traits here.
Conditionable and Tappable0:40
dynamic functions. And there are two other core Laravel traits here. Conditionable is able to conditionally apply a fluent method to an object, using this when method here. And finally, Tappable is able to tap into an object, run a method on it, and then return the original object again to allow further method chaining. As you can see, this component class has 178 inheritors, and these are all components that you can find within filament. For example, all of the form components here, and all of the actions, and table columns, and table layout components and summarizers, and all of the InfoList components, and table
Extending Base Component1:09
For example, all of the form components here, and all of the actions, and table columns, and table layout components and summarizers, and all of the InfoList components, and table filters. Each of these classes has access to all of the features that we've discussed in this series so far. When you're building a custom component for filament, you're always going to be extending this base component class which has all these features. You will not have to use any of these traits yourself. Another very important class within the FilamentSupport package is the ViewComponent class. This class extends that base component class and makes it renderable.
Introducing ViewComponent1:43
Another very important class within the FilamentSupport package is the ViewComponent class. This class extends that base component class and makes it renderable. As you can see, 162 of the 178 inheritors of the component class actually have rendering functionality. A few methods that we get here are view, which allows a user to customize the view that's being rendered for a component. This component also passes in the public methods to the view without you having to implement that functionality manually. Users of a component that extends ViewComponent can also pass in viewData just for that component. And finally, all of the rendering functionality is also contained within this class.
Built-in Rendering Features2:17
Users of a component that extends ViewComponent can also pass in ViewData just for that component. And finally, all of the rendering functionality is also contained within this class. You won't have to override or set a render method for every single one of your custom components.
