1. Go to this page and download the library: Download artisanpack-ui/forms library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use ArtisanPackUI\Forms\Events\FormCreated;
use ArtisanPackUI\Forms\Events\FormSubmitted;
use ArtisanPackUI\Forms\Events\SubmissionDeleted;
// Listen for form submissions
Event::listen(FormSubmitted::class, function ($event) {
// $event->submission contains the submission
// $event->form contains the form
});
use function addFilter;
addFilter('forms.field_types', function (array $types) {
$types['my-custom-field'] = [
'label' => 'My Custom Field',
'view' => 'my-package::fields.custom',
'settings' => ['option1', 'option2'],
];
return $types;
});