Components

Table of contents

  1. Overview
  2. Card Component
  3. Form Component
  4. Table Component

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:

  1. --form-method=<method_name> - Sets the method for the form with a default as post.
  2. --enctype=<mime_type> - Sets the enctype with application/x-www-form-urlencoded as the default even if attribute is not listed in form element. Use multipart/form-data for file uploads and text/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.