Skip to content

Commit bdface4

Browse files
committed
Initial release v1.0.0
0 parents  commit bdface4

27 files changed

Lines changed: 1782 additions & 0 deletions

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Form Builder - Contensio plugin.
2+
3+
Copyright (c) 2026 Iosif Gabriel Chimilevschi
4+
Contensio is operated by Host Server SRL.
5+
6+
This program is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU Affero General Public License as
8+
published by the Free Software Foundation, either version 3 of the
9+
License, or (at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU Affero General Public License for more details.
15+
16+
You should have received a copy of the GNU Affero General Public License
17+
along with this program. If not, see <https://www.gnu.org/licenses/>.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Form Builder
2+
3+
Create custom forms and embed them on any page. Build forms with multiple field types, collect submissions, receive email notifications, and export data as CSV.
4+
5+
## Features
6+
7+
- **Visual form builder** - add, edit, reorder, and remove fields from a builder canvas
8+
- **16 field types** - text, textarea, email, number, URL, phone, dropdown, radio, checkboxes, date, time, hidden, consent, heading, paragraph, divider
9+
- **Block type embed** - forms register as a "Form" block type; embed on any page using the block editor
10+
- **Direct URL** - each form also has a standalone public URL (`/forms/{slug}`)
11+
- **Submissions inbox** - view all responses with status (new, read, starred, archived)
12+
- **CSV export** - download all submissions as a CSV file
13+
- **Email notifications** - get notified by email when a form is submitted
14+
- **Honeypot anti-spam** - invisible honeypot field to catch bots, no CAPTCHA needed
15+
- **Success message** - custom thank-you message or redirect to external URL after submission
16+
- **Half-width fields** - fields can be set to half width for two-column layouts
17+
- **Dynamic validation** - required fields, email/URL/number/date type checks
18+
- **Choice field options** - define options as JSON arrays for dropdowns, radio buttons, and checkboxes
19+
20+
## Setup
21+
22+
1. Enable the plugin in the admin Plugins panel.
23+
2. Go to **Forms** to create your first form.
24+
3. Add fields in the Builder, then set the form status to "Active" in Settings.
25+
4. Embed the form on a page using the "Form" block type, or link to `/forms/{slug}`.
26+
27+
## Block Type
28+
29+
The plugin registers a `form-embed` block type on install. When adding blocks to a page in the editor, select **Form** and configure it with the form ID. The form renders inline within the page content.
30+
31+
## License
32+
33+
AGPL-3.0-or-later. See LICENSE file.

composer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "contensio/plugin-forms",
3+
"description": "Form Builder plugin for Contensio. Create custom forms with drag-and-drop fields. Embed in pages via block type. Submissions inbox and CSV export.",
4+
"type": "library",
5+
"license": "AGPL-3.0-or-later",
6+
"keywords": ["contensio", "plugin", "forms", "form-builder", "submissions"],
7+
"homepage": "https://contensio.com",
8+
"authors": [
9+
{
10+
"name": "Iosif Gabriel Chimilevschi",
11+
"homepage": "https://contensio.com",
12+
"role": "Creator"
13+
}
14+
],
15+
"require": {
16+
"php": "^8.2",
17+
"contensio/contensio": "^2.0"
18+
},
19+
"autoload": {
20+
"psr-4": {
21+
"Contensio\\Forms\\": "src/"
22+
}
23+
},
24+
"extra": {
25+
"cms": {
26+
"type": "plugin",
27+
"provider": "Contensio\\Forms\\FormsServiceProvider"
28+
}
29+
},
30+
"minimum-stability": "stable",
31+
"prefer-stable": true
32+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
public function up(): void
10+
{
11+
Schema::create('contensio_forms', function (Blueprint $table) {
12+
$table->id();
13+
$table->string('title', 200);
14+
$table->string('slug', 200)->unique();
15+
$table->text('description')->nullable();
16+
$table->enum('status', ['draft', 'active', 'closed'])->default('draft');
17+
$table->text('success_message')->nullable();
18+
$table->string('redirect_url', 2000)->nullable();
19+
$table->boolean('send_notification_email')->default(false);
20+
$table->json('notification_emails')->nullable();
21+
$table->boolean('antispam_honeypot')->default(true);
22+
$table->unsignedInteger('submissions_count')->default(0);
23+
$table->timestamps();
24+
$table->softDeletes();
25+
26+
$table->index('status');
27+
});
28+
29+
Schema::create('contensio_form_fields', function (Blueprint $table) {
30+
$table->id();
31+
$table->foreignId('form_id')->constrained('contensio_forms')->cascadeOnDelete();
32+
$table->string('type', 30);
33+
$table->string('label', 500);
34+
$table->string('description', 1000)->nullable();
35+
$table->string('placeholder', 500)->nullable();
36+
$table->string('name', 100);
37+
$table->boolean('is_required')->default(false);
38+
$table->enum('width', ['full', 'half'])->default('full');
39+
$table->json('options')->nullable();
40+
$table->json('validation')->nullable();
41+
$table->unsignedSmallInteger('sort_order')->default(0);
42+
$table->timestamps();
43+
44+
$table->index(['form_id', 'sort_order']);
45+
});
46+
47+
Schema::create('contensio_form_submissions', function (Blueprint $table) {
48+
$table->id();
49+
$table->foreignId('form_id')->constrained('contensio_forms')->cascadeOnDelete();
50+
$table->json('data');
51+
$table->enum('status', ['new', 'read', 'starred', 'archived'])->default('new');
52+
$table->string('ip_address', 45)->nullable();
53+
$table->string('user_agent', 500)->nullable();
54+
$table->timestamp('submitted_at')->nullable();
55+
$table->timestamps();
56+
57+
$table->index(['form_id', 'status']);
58+
$table->index(['form_id', 'submitted_at']);
59+
});
60+
}
61+
62+
public function down(): void
63+
{
64+
Schema::dropIfExists('contensio_form_submissions');
65+
Schema::dropIfExists('contensio_form_fields');
66+
Schema::dropIfExists('contensio_forms');
67+
}
68+
};

lang/en/contensio-forms.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
return [
4+
5+
'admin' => [
6+
'forms' => 'Forms',
7+
'new_form' => 'New Form',
8+
'builder' => 'Builder',
9+
'settings' => 'Settings',
10+
'submissions' => 'Submissions',
11+
'no_forms' => 'No forms found.',
12+
'no_submissions' => 'No submissions yet.',
13+
'created' => 'Form created.',
14+
'deleted' => 'Form deleted.',
15+
'settings_saved' => 'Form settings saved.',
16+
'add_field' => 'Add Field',
17+
'export_csv' => 'Export CSV',
18+
],
19+
20+
'builder' => [
21+
'fields' => 'Fields',
22+
'add_field' => 'Add Field',
23+
'no_fields' => 'No fields yet. Add fields from the panel on the right.',
24+
'field_added' => 'Field added.',
25+
'field_updated' => 'Field updated.',
26+
'field_removed' => 'Field removed.',
27+
],
28+
29+
'public' => [
30+
'submit' => 'Submit',
31+
'success' => 'Thank you! Your submission has been received.',
32+
],
33+
34+
];

plugin.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "contensio/plugin-forms",
3+
"label": "Form Builder",
4+
"description": "Visual form builder. Create custom forms with multiple field types. Embed in any page via block type. Submissions inbox, email notifications, CSV export.",
5+
"author": "Contensio",
6+
"author_url": "https://contensio.com",
7+
"version": "1.0.0",
8+
"provider": "Contensio\\Forms\\FormsServiceProvider",
9+
"autoload": {
10+
"psr-4": {
11+
"Contensio\\Forms\\": "src/"
12+
}
13+
},
14+
"requires": {
15+
"cms": "^2.0"
16+
},
17+
"menu": [
18+
{
19+
"placement": "content",
20+
"label": "Forms",
21+
"icon": "bi-ui-checks-grid",
22+
"route": "contensio-forms.admin.index",
23+
"permission": "plugins.configure"
24+
}
25+
],
26+
"removable": true
27+
}

0 commit comments

Comments
 (0)