👷♂️ Now making:
- Nimble Links – Redirect clicks evenly, randomly, or based on other parameters.
Create and manage surveys within your Laravel app.
License: MIT License
👷♂️ Now making:
On fresh laravel/filament install
when run php artisan migrate - error: Cannot declare class CreateSurveysTable, because the name is already in use..
Library that provides collection, processing, and rendering functionality for PHP code coverage information.
Library home page: https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bb7c9a210c72e4709cdde67f8b7362f672f2225c
Dependency Hierarchy:
JavaScript library for DOM operations
Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
Path to vulnerable library: laravel-survey/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js
Dependency Hierarchy:
In jQuery versions greater than or equal to 1.0.3 and before 3.5.0, passing HTML containing elements from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.
Publish Date: 2020-04-29
URL: CVE-2020-11023
Base Score Metrics:
Type: Upgrade version
Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11023
Release Date: 2020-04-29
Fix Resolution: jquery - 3.5.0
Step up your Open Source Security Game with WhiteSource here
Hi, could anyone help me about multi steps form?
my app have 108 questions, all of which are mandatory. The first 8 questions are the basic information of the client filling in, including text type and radio type. The next 100 questions are for analysis, all of which are radio types. now i got single page form working, but not for multi steps.
I plan to split into 8+20+20+20+20+20 steps, how to adjust blade file? i defined function for step number increase, and the variables for blade file, something like this:
$step1 = $survey->questions->slice(0, 8, true);
$step2 = $survey->questions->slice(8, 20, true);
$step3 = $survey->questions->slice(28, 20, true);
$step4 = $survey->questions->slice(48, 20, true);
$step5 = $survey->questions->slice(68, 20, true);
$step6 = $survey->questions->slice(88, 20, true);
@if($currentStep == 1)
@foreach($step1 as $key => $question)
@include('survey::questions.single')
@Endforeach
@endif
but not working, maybe related to pass variables between steps, please give some details about how to do multi steps?
A common use case is "Other Specify" where if a user selects other, a text field is displayed to allow a user to enter text for the option
Is this in the road map or any suggestions for an implementation approach so that I can help push a PR
Hi,
I found your approach really interesting but, I don't understand the Entry::for(...
method.
It's a non-static method being called as a static one, that will not work I'm afraid.
First of all thanks for the amazing work you have done.
It'd be appreciated if ability of multichoice questions (entries) added to the library.
I would like to be able to allow my users to answer my survey one section at a time, but they are only allowed to complete the survey once. Currently, this throws a MaxEntriesPerUserLimitExceeded exception. Is it within the realms of laravel survey to only throw this exception once the survey has been completed and all questions answered?
If not, could you point me in the right direction for allowing this?
Hi, If you don't mind, could you show an example of multiselect question validation?
'rules' => ['nullable', 'array']
i want validate values inside array too, thx.
I want to show view but you not describe which variable i have to pass in view and how your pagination work
Hello
please is there anyway to migrate your package with this package https://github.com/qcod/laravel-gamify i already use it and i want to use it with your package
i tried this :
$d = (new Entry)->for($survey)->by(Auth::user())->fromArray($answers)->push();
givePoint(new SurveyAnswered($d));
in the my controller and in push method in entry model i returned to $this
Could you help me please ?
Hi,
i'm trying to display both sections and questions in the same view, but i can see only questions. What am i missing ?
Hi Matt, my participant ID is coming through as null when i create an entry. I have seen a similar question asked before and you said to put this (new Entry)->for($survey)->by($user)->fromArray($answers)->push();
. But my issue is i do not know where to put this in to resolve this issue
Can you please add a feature to have star ratings out of 5 stars along with results i.e. the average star rating that all the users gave? It would be very helpful.
Hello everyone,
I have been trying to using Survey package with authenticated users, and I have already could get this.
but What I'm asking about, It's removing logged user requirement to do the survey.
This is my: views/vendor/survey/standard.blade.php
`
@if(!$eligible)
Nós aceitamos apenas
<strong>{{ $survey->limitPerParticipant() }}
{{ \Str::plural('entrada', $survey->limitPerParticipant()) }}</strong>
por participante.
@endif
@if($lastEntry)
Você já enviou as suas respostas <strong>{{ $lastEntry->created_at->diffForHumans() }}</strong>.
@endif
</div>
@if(!$survey->acceptsGuestEntries() && auth()->guest())
<div class="p-5">
Porfavor faça o <a href="{{ route('login') }}">login</a> para fazer essa pesquisa.
</div>
@else
@foreach($survey->sections as $section)
@include('survey::sections.single')
@endforeach
@foreach($survey->questions()->withoutSection()->get() as $question)
@include('survey::questions.single')
@endforeach
@if($eligible)
<button class="btn btn-primary">Enviar</button>
@endif
@endif
Hello i made a blade with including the survey but how to make a form to collect the entries and push them in db ?
Hi . is it possible limit-per-participant with guest submit by passing unique id to survey then the page refresh it's self to setting this ID as hidden input ?
also could we pass special parameter like the name of the participant to survey as " Welcome Firstname Lastname !" ?
Thanks for this project
To create a question that is a dropdown list and the user can select one of them
Hi,
I want to add 2 fields to the Entry model, one to save the fingerprint of the browser, and the other to save the converted time. This way I can identify different Guest users roughly. I have solved the way of generating fingerprints, and adding database fields is not a problem.
My question are, what is the proper way to define custom fields of Entry model? how to save the data of new fields when user submit answers?
or may be i ask wrong question, should i add fields to other model?
Hello,
From the example views in the type partial I can see that there are two variables $value, $disabled
where this are passed throw ?
Here is the code snippet:
@component('survey::questions.base', compact('question'))
@foreach($question->options as $option)
<div class="custom-control custom-radio">
<input type="radio"
name="{{ $question->key }}"
id="{{ $question->key . '-' . Str::slug($option) }}"
value="{{ $option }}"
class="custom-control-input"
{{ ($value ?? old($question->key)) == $option ? 'checked' : '' }}
{{ ($disabled ?? false) ? 'disabled' : '' }}
>
<label class="custom-control-label"
for="{{ $question->key . '-' . Str::slug($option) }}">{{ $option }}
@if($includeResults ?? false)
<span class="text-success">
({{ number_format((new \MattDaneshvar\Survey\Utilities\Summary($question))->similarAnswersRatio($option) * 100, 2) }}%)
</span>
@endif
</label>
</div>
@endforeach
@endcomponent
Thanks
Hi! I'm not sure it's something to ask here, but since it's also related to the way you built your component, I'll do.
I'd like to extend Survey and Entry models so I can add more methods inside. I added app/Models/Survey/Survey.php
and .../Entry.php
models extending those in vendors directory. Everything is working fine, however, I need vendor/.../Models/Entry->survey()
and vendor/.../Models/Survey->entries()
to map my extended classes instead of those inside the vendor directory. The same for the rest of model relationships related methods. I was be able to achieve this by overriding those specific methods in my model, but I feel this is not the right approach. I also googled it and saw another approaches, but I'm still not convinced since they look like workarounds uglier than mine.
What do you think it's the best I can do to handle this?
Thank you in advance.
Example of what I did:
# app/Models/Survey/Survey.php:
namespace App\Models\Survey;
class Survey extends \MattDaneshvar\Survey\Models\Survey
{
...
public function entries()
{
return $this->hasMany(Entry::class); // App\Models\Survey\Entry
}
}
MANY THANKS FOR AWSOME PACKAGE, I integrated it in my system , but as I see in the base.blade.php there is variable name $report , but this variable not return any things, can u please guide me to generate the report please
$valid = $request->validate([
'options1s' => 'required',
'options2s' => 'required',
'options3s' => 'required',
'options4s' => 'required'
]);
$survey->questions()->create([
'content' => $question,
'type' => 'mutliselect',
'options' => [$request->options1s, $request->options2s, $request->options3s, $request->options4s]
]);
While building the survey form the type "mutliselect" doesn't work as expected
Library that provides collection, processing, and rendering functionality for PHP code coverage information.
Library home page: https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bb7c9a210c72e4709cdde67f8b7362f672f2225c
Dependency Hierarchy:
JavaScript library for DOM operations
Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
Path to vulnerable library: laravel-survey/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js/jquery.min.js
Dependency Hierarchy:
In jQuery versions greater than or equal to 1.2 and before 3.5.0, passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.
Publish Date: 2020-04-29
URL: CVE-2020-11022
Base Score Metrics:
Type: Upgrade version
Origin: https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/
Release Date: 2020-04-29
Fix Resolution: jQuery - 3.5.0
Step up your Open Source Security Game with WhiteSource here
Hi,
Your app seems interesting, but looking at the source code I stumbled upon some strange entry.
In the Answer model, you're using the Question::class in place of the Entry::class
laravel-survey/src/Models/Answer.php
Line 37 in 9982df3
Dear Master,
Thank you so much for the solution
i completely integrated with laravel-survey, how I can set the disabled element?
@component('survey::questions.base', compact('question'))
<input type="number" name="{{ $question->key }}" id="{{ $question->key }}" class="form-control"
value="{{ old($question->key) }}" {{ ($disabled ?? false) ? 'disabled' : '' }}>
@slot('report')
@if($includeResults ?? false)
{{ number_format((new \MattDaneshvar\Survey\Utilities\Summary($question))->average()) }} (Average)
@endif
@endslot
@endcompone
```nt
Hi Matt,
Great work on this package. I am just wondering if you know how I could send this survey to a specific email address so they can complete it? and if possible allow an admin to view the answers once they submit.
Thanks
Migrating: 2021_12_18_180211_create_questions_table
...
PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null, rules
json null, created_at
timestamp null, updated_at
timestam' at line 1")
It seems this doesn't work with MariaDB, which is fairly common on Linux servers.
Hi.
I get an error 500 on the live app. It works perfectly fine on Valet.
When I check the logs, the message says:
[2023-04-23 02:30:26] production.ERROR: No hint path defined for [survey]. (View: /home/forge/domain/resources/views/admin/surveys/show.blade.php) {"userId":10,"exception":"[object] (Illuminate\View\ViewException(code: 0): No hint path defined for [survey]. (View: /home/forge/domain/resources/views/admin/surveys/show.blade.php) at /home/forge/domain/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:112)
@include('survey::standard', ['survey' => $survey])
I now know how to make the survey appear o the list, but how do you make the controller to process the survey and add a new entry when the submit button is clicked?
Migrating: 2021_12_18_180211_create_answers_table
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''
Seems there is a missing config/Survey.php? for config('survey.database.tables.answers')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.