Components
Table of contents
1. Overview Table of Contents
Components are blocks of code that can be reused between different views or multiple times within the same view. Running the make:component
command generates a new component at resources/views/components
.
2. Card ComponentTable of Contents
Running the following,
php console make:component my_card --card,
generates a card component.
3. Form ComponentTable of Contents
You can create a form by running the following,
php console make:component my_form --form
There are 2 flags that you can set as described below:
--form-method=<method_name>
- Sets the method for the form with a default aspost
.--enctype=<mime_type>
- Sets the enctype withapplication/x-www-form-urlencoded
as the default even if attribute is not listed in form element. Usemultipart/form-data
for file uploads andtext/plain
for ambiguous format, human-readable content not reliably interpretable by computer.
4. Table ComponentTable of Contents
Running the following,
php console make:component my_table --table,
generates a table component.