laravel-revisionable icon indicating copy to clipboard operation
laravel-revisionable copied to clipboard

Not creating revisions table on Laravel 5.5

Open jayzyaj opened this issue 6 years ago • 4 comments

I followed the instructions as said in the documentation I have a revisionable in my config. But when I try to migrate it. It does not create a revisions table.

Here is some samle code.

use JohannesSchobel\Revisionable\Traits\Revisionable;

class AnalysisRequest extends Model
{
    use SoftDeletes;
    use Revisionable;
    
        public $table = 'analysis_requests';
        
        protected $revisionable = [
            'sample_description',
            'special_instruction',
            'rushable',
            'status'
        ];

        protected $revisionLimitCleanup = true; // only works with revisionLimit
        protected $revisionLimit = 50;  // keep 50 instead of 20 revisions of this model
    
        protected $dates = ['deleted_at', 'date_analyzed'];

jayzyaj avatar Jul 13 '18 14:07 jayzyaj

Have you published the migration and config file from the package?

johannesschobel avatar Jul 13 '18 14:07 johannesschobel

I run this command php artisan vendor:publish --provider="JohannesSchobel\Revisionable\RevisionableServiceProvider" and it created a revisionable in my config but when I try to migrate it. It does not create a revisions table. Thanks for the fast reply

jayzyaj avatar Jul 13 '18 14:07 jayzyaj

This is indeed a bug.. the migration file is not published..

Can you copy / paste the migration file from the package folder to your database/migrations folder and run artisan migrate again

johannesschobel avatar Jul 13 '18 14:07 johannesschobel

Hi there. I tried to add it and the migration went to success with the revisions table. However I got this error when I created an object of the model I want to make revisions of. I got this error below:

Target [JohannesSchobel\Revisionable\Interfaces\UserProvider] is not instantiable while building [JohannesSchobel\Revisionable\Laravel\Listener].

jayzyaj avatar Jul 14 '18 08:07 jayzyaj