Package Data | |
---|---|
Maintainer Username: | euventura |
Maintainer Contact: | victor.ventura@convenia.com.br (Victor Ventura) |
Package Create Date: | 2017-06-02 |
Package Last Update: | 2018-05-11 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-19 03:10:06 |
Package Statistics | |
---|---|
Total Downloads: | 15,220 |
Monthly Downloads: | 36 |
Daily Downloads: | 1 |
Total Stars: | 7 |
Total Watchers: | 8 |
Total Forks: | 3 |
Total Open Issues: | 2 |
Add checklist in your project associated any model in your project
composer require convenia/checklistable
php artisan vendor:publish --tag="checklistable"
php artisan migrate
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Convenia\Checklistable\Traits\ChecklistableTrait;
class ModelClass extends Model
{
use ChecklistableTrait;
// Return ChecklistService Object
ModelClass::checklist($type, $ownerId);
// Return Checklist Model, if not existe will create it
ModelClass::checklist($type, $ownerId)->get();
// Return QuestionService Object
ModelClass::checklist($type, $ownerId)
->questions();
// Return Collection of questions
ModelClass::checklist($type, $ownerId)
->questions()
->get();
// add and return question in lot (only if empty)
ModelClass::checklist($type, $ownerId)
->questions()
->fill([]);
// delete one question
ModelClass::checklist($type, $ownerId)
->questions()
->delete($questionId);
// add one question an d return all
ModelClass::checklist($type, $ownerId)
->questions()
->add([
'question' => 'What does Marcellus wallace looks like ?'
]);
// Return QuestionService Object
ModelClass::checklist($type, $ownerId)
->answer();
// retrive all answers about checklistable, if do not have, fill it
ModelClass::checklist($type, $ownerId)
->answer()
->get($checklistableId);
// fill the answers with the questions
ModelClass::checklist($type, $ownerId)
->answer()
->start($checklistableId);
// change answer response
ModelClass::checklist($type, $ownerId)
->answer()
->start($checklistableId, $answerId, $answer = true)
Checklistable is open-sourced software licensed under the MIT license