Require this package, with Composer, in the root directory of your project.
$ composer require artisanry/questionable
To get started, you'll need to publish the vendor assets and migrate:
php artisan vendor:publish --provider="Artisanry\Questionable\QuestionableServiceProvider" && php artisan migrate
<?php
namespace App;
use Artisanry\Questionable\HasQuestions;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasQuestions;
}
$post->createQuestion([
'title' => 'Some title',
'body' => 'Some body',
], $user);
$post->updateQuestion(1, [
'title' => 'new title',
'body' => 'new body',
]);
$post->deleteQuestion(1);
$question->createAnswer([
'title' => 'Some title',
'body' => 'Some body',
], $user);
$question->updateAnswer(1, [
'title' => 'new title',
'body' => 'new body',
]);
$question->deleteAnswer(1);
$answer->markAsSolution();
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING and CONDUCT for details.
$ phpunit
If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.
This project exists thanks to all the people who contribute.
Mozilla Public License Version 2.0 (MPL-2.0).