This package is abandoned and no longer maintained. No replacement package was suggested.

Questionable Polymorphic Eloquent Models for Laravel 5

3.2.0 2019-08-28 13:05 UTC

This package is auto-updated.

Last update: 2020-02-28 14:44:15 UTC


Build Status PHP from Packagist Latest Version License


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


Setup a Model


namespace App;

use Artisanry\Questionable\HasQuestions;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
    use HasQuestions;

Ask a question

    'title' => 'Some title',
    'body' => 'Some body',
], $user);

Update a question

$post->updateQuestion(1, [
    'title' => 'new title',
    'body' => 'new body',

Delete a question


Answer to a question

    'title' => 'Some title',
    'body' => 'Some body',
], $user);

Update an answer

$question->updateAnswer(1, [
    'title' => 'new title',
    'body' => 'new body',

Delete an answer


Mark an answer as solution


Change log

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 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).