Search by

nikoleesg / survey

nikoleesg

Store and query survey variables, answers and paradata for Laravel

Package info

github.com/nikoleesg/survey

pkg:composer/nikoleesg/survey

Statistics

Installs: 61

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 6

2.0.0 2025-12-04 05:08 UTC

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require nikoleesg/survey

You can publish and run the migrations with:

php artisan vendor:publish --tag="survey-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="survey-config"

This is the contents of the published config file:

return [
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="survey-views"

Usage

$survey = new Nikoleesg\Survey();
echo $survey->echoPhrase('Hello, Nikoleesg!');

Exceptions

Every exception the package throws extends Nikoleesg\Survey\Exceptions\SurveyException (a RuntimeException), so a single catch (SurveyException $e) covers them all.

Exception Thrown when
MissingSurveyIdException No survey id could be resolved: none passed, none set via setSurvey(), and survey.survey_id is null or empty.
UnreadableFileException A get*FromFile() loader is given a path that does not exist or cannot be read. The message names the loader and the path.
NoDataLoadedException persist() or getData() is called before any get*FromFile() loader.
UnparseableColumnException A non-blank DATETIME/DATE/TIME column in the closed-answer file does not match its survey.formats.* pattern. The message names the interview, variable, raw value and format. Blank columns are stored as null, not thrown.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.