nikoleesg / survey
Store and query survey variables, answers and paradata for Laravel
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- larautil/foundation: ^1.0
- spatie/eloquent-sortable: ^4.0
- spatie/laravel-data: ^4.0
- spatie/laravel-enum: ^3.0
- spatie/laravel-package-tools: ^1.14.0
- spatie/laravel-sluggable: ^3.5
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-15 14:14:23 UTC
README
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.