hybridelabs / collustro
Create surveys for Laravel the easy way.
0.9.7
2020-12-23 14:43 UTC
Requires
- php: ^7.4
- ext-json: *
Requires (Dev)
- orchestra/testbench: ^4.0
- sensiolabs/security-checker: ^6.0
- symplify/easy-coding-standard: ^7.2
- vimeo/psalm: ^3.0@dev
This package is auto-updated.
Last update: 2024-10-23 21:37:55 UTC
README
Surveys made easy for Laravel
Installation
Require the package with composer:
composer require hybridelabs/collustro
Publish the migrations (required), the configuration (optional) and views (recommended):
php artisan vendor:publish --provider="HybrideLabs\Collustro\CollustroServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="HybrideLabs\Collustro\CollustroServiceProvider" --tag="config"
php artisan vendor:publish --provider="HybrideLabs\Collustro\CollustroServiceProvider" --tag="views"
Run the migrations to create the required tables:
php artisan migrate
Usage
Create a survey
A simple one:
$collustro = Sets::create(["name" => "Animals"]);
$collustro->questions()->create([
"content" => "Your favorite pet?",
"type" => "text",
]);
Add an Entry
From an array:
(new Entry())->for($collustro)->fromArray([
"q1" => "My kitty."
]);