1. Go to this page and download the library: Download jangraviren/laravel-survey library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jangraviren / laravel-survey example snippets
// Get all question that a user has
Question::answered(false)->get()
return [
'models' => [
/*
* We need to know which Eloquent model should be used to retrieve your categories.
* Of course, it is often just the "Category" model but you may use whatever you like.
*
* The model you want to use as a Category model needs to implement the
* `JangraViren\Survey\Contracts\Category` contract.
*/
'category' => JangraViren\Survey\Models\Category::class,
/*
* We need to know which Eloquent model should be used to retrieve your questions.
* Of course, it is often just the "Question" model but you may use whatever you like.
*
* The model you want to use as a Question model needs to implement the
* `JangraViren\Survey\Question\Category` contract.
*/
'question' => JangraViren\Survey\Models\Question::class,
/*
* We need to know which Eloquent model should be used to retrieve your answers.
* Of course, it is often just the "Answer" model but you may use whatever you like.
*
* The model you want to use as a Answer model needs to implement the
* `JangraViren\Survey\Question\Answer` contract.
*/
'answer' => JangraViren\Survey\Models\Answer::class,
/*
* We need to know which Eloquent model should be used to assign the answers to.
* Of course, it is often just the "User" model but you may use whatever you like.
*/
'user' => App\User::class,
],
];