backend.list.overrideRecordAction

Triggered in Backend\Widgets\Lists.

Overrides the record url or onclick event in a list widget.

If a value is returned from this event, it will be used as the url for the provided record. $url contains the default url and $record is a reference to the model instance. Example usage:

Event::listen('backend.list.overrideRecordAction', function ($listWidget, $record, $url, $onClick) {
    if ($record->user_id !== BackendAuth::getUser()->id) {
        return 'acme/blog/posts/preview/' . $record->id;
    }
});

Or

$listWidget->bindEvent('list.overrideRecordAction', function ($record, $url, $onClick) {
    if ($record->user_id !== BackendAuth::getUser()->id) {
        return 'acme/blog/posts/preview/' . $record->id;
    }
});