VentureCraft / revisionable

Easily create a revision history for any laravel model
http://twitter.com/duellsy
MIT License
2.55k stars 349 forks source link

Compatibility with Laravel 5.* #233

Open lupoair opened 8 years ago

lupoair commented 8 years ago

Can anybody state the compatibilty of Revisionable and the latest Laravel or LTS?

I think this should also be documented by rule.

209 states it doesn't work with standard 5.2 user model.

While pull request #207 offers little help with migrations.

What is the overall state of this project?

stierler commented 8 years ago

Hi @lupoair - Revisionable is compatible with the latest releases of Laravel, as well as 4.2. In regard to the first ticket, I've asked for more information - but I can confirm on my 5.2 install, revisions are working on all my models as expected.

207 is just a documentation issue for the migration, which will be addressed in the docs soon.

We are contemplating splitting Laravel 4.x support out into it's own branch to continue the development of this project for 5.x and above.

naveensnayak commented 7 years ago

is this compatible with laravel 5.3 ?

barryvanveen commented 7 years ago

Hi @naveensnayak,

Yeah it is working with Laravel 5.3 for me.

Laravel 5.4 also seems to work but you have to change the events in a slightly different way than described in the readme:

// app/Providers/EventServiceProviders.php
public function boot(DispatcherContract $events)
{
    parent::boot($events);

    $events->listen('revisionable.*', function($eventName, $data) {
        // $eventName = revisionable.created, revisionable.saved or revisionable.deleted
        // $data['model']
        // $data['revisions']
    });
}
rogeel commented 7 years ago

Laravel 5.4

public function boot()
{
        parent::boot();

        Event::listen('revisionable.*', function($model, $revisions) {
            // Do something with the revisions or the changed model. 
            dd($model, $revisions);
        });
}
poldiwa commented 5 years ago

some things dont work on laravel 5.8

Events

The fire method (which was deprecated in Laravel 5.4) of the Illuminate/Events/Dispatcher class has been removed. You should use the dispatch method instead.

Testing

The setUp and tearDown methods now require a void return type: https://laravel.com/docs/5.8/upgrade