Skip to content

Telescope Incompatibity #226

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
xyrintech opened this issue Mar 27, 2019 · 9 comments
Closed

Telescope Incompatibity #226

xyrintech opened this issue Mar 27, 2019 · 9 comments

Comments

@xyrintech
Copy link

Describe the bug
ErrorException : Undefined offset: 0

at /home/ubuntu/workspace/new/vendor/laravel/telescope/src/Watchers/ModelWatcher.php:36

Environment

  • PHP: 7.3
  • OS: Ubuntu 16.x
  • Laravel: 5.8
  • Model Caching: 0.4.11
@mikebronner
Copy link
Owner

@xyrintech That seems to be a Laravel Telescope issue. Please provide a full stack trace so we can further investigate.

@ggomuk
Copy link

ggomuk commented Mar 28, 2019

Hi

I have the same problem. finally found a reason.

Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Undefined offset: 0", "/var/www/vendor/laravel/telescope/src/Watchers/ModelWatcher.php", ["eloquent.updated: App\AC\AcUser"])

In Traits/Cacheable
use Fico7489\Laravel\Pivot\Traits\PivotEventTrait > ExtendFireModelEventTrait

That Override Model fireModelEvent so

$payload = ['model' => $this, 'relation' => $relationName, 'pivotIds' => $ids, 'pivotIdsAttributes' => $idsAttributes];

return !empty($result) ? $result : static::$dispatcher->{$method}("eloquent.{$event}: ".static::class, $payload);

In Laravel Telescope Model Watch

$model = FormatModel::given($data[0]);
$changes = $data[0]->getChanges();

That’s reason.

@corsair
Copy link

corsair commented Mar 28, 2019

Also experiencing the same. Seems disabling ModelWatch via the Telescope config may be the best option for the time being.

Seems identical to #185 though.

@mikebronner
Copy link
Owner

mikebronner commented Mar 28, 2019

@ggomuk Thanks for tracking this down.

This issue is logged here: fico7489/laravel-pivot#55
Also, duplicate of #185 (thanks @corsair)
And discussed in Telescope: laravel/telescope#187

Closing this issue for now, as this is occurring outside of the package. If you find a fix for it, please submit a PR to laravel-pivot, otherwise let me know here, and I will submit a PR to laravel-pivot.

@mikebronner
Copy link
Owner

Reopening this, as I am having issues running Telescope as well. Will need to do some further investigation to see where this comes from.

@mikebronner
Copy link
Owner

For now I added a work-around in the README and included the Model Watcher class in the code-base to make it easy to implement for Laravel Model Caching users. Looking forward to seeing Laravel Pivot package being updated to be compatible with Telescope.

@mikebronner
Copy link
Owner

@xyrintech @ggomuk @corsair Please give release 0.4.19 or above a shot and let me know how it works for you. I updated the README with instructions for Telescope compatibility. It's just a work-around for now.

@mikebronner
Copy link
Owner

mikebronner commented May 16, 2019

Re-opening this, as the Telescope front-end will not display custom watchers. My recommendation for now is to implement the custom watcher, and forgo the front-end capability in Telescope until the package is updated. I'm considering permanently forking my own version of the laravel-pivot, as it has been a limitation multiple times in the past.

@mikebronner
Copy link
Owner

@xyrintech @ggomuk @corsair This has now been fixed as of version 0.4.21 and will no longer require a work-around. It should work with Telescope out of the box. Please let me know if you are still experiencing an issue with this after updating. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants