{"repo":"givebutter/laravel-custom-fields","free":true,"listed":false,"github":"https://github.com/givebutter/laravel-custom-fields","clone":"git clone https://github.com/givebutter/laravel-custom-fields.git","description":"Add custom fields to your Laravel models.","language":"PHP","stars":175,"topics":["laravel","custom-fields","survey"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Custom Fields ⚠️ Warning: these docs are incomplete and may reference unsupported functions. This is a pre-release version that is not yet ready for production use. Laravel Custom Fields is a package that allows you to add custom fields to any Laravel model and associate responses to those fields with other models. Installation To get started, add the givebutter/laravel-custom-fields package to your composer.json file and update your dependencies: Publish the migration: Run the migration: You can customize the table names using configuration options. More on that later. An example - Survey App For the purposes of the documentation, lets use the example of a Survey building app. Administrators might use a backend to create Surveys full of questions and end users might then fill out those surveys, generating SurveyResponses . Preparing your models Adding custom fields To add basic custom field support, simply add the HasCustomFields trait at the top of your model: Adding custom field responses Next, we add support to store custom field responses. We'll simply pull in the HasCustomFieldResponses trait at the top of our SurveyResponse model. Basic usage Creating fields You can add a field to a model like this: Each field can contain the following: (More on these later) title : The title / question of your custom field. description : The description of your field. Useful for providing more context to user filling out fields. type : The type of field you're creating. Availa","default_branch":null,"files":null,"tree":[],"storefront":"/r/givebutter","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/givebutter/laravel-custom-fields/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}