laravel-revisionable
laravel-revisionable copied to clipboard
Not creating revisions table on Laravel 5.5
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'];
Have you published the migration and config file from the package?
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
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
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].