File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,38 @@ composer require genealabs/laravel-model-caching:*
4848```
4949
5050## Configuration
51+ ### Telescope Compatibility
52+ Due to how a dependent package fires pivot events that are currently
53+ incompatible with Laravel Telescope, you will need to adjust your Model Watcher
54+ in your Telescope configuration, if you use Telescope (if not, you can safely
55+ ignore this section):
56+
57+ ``` php
58+ use GeneaLabs\LaravelModelCaching\Telescope\ModelWatcher as CustomModelWatcher;
59+ // ...
60+
61+ return [
62+
63+ // ...
64+
65+ 'watchers' => [
66+
67+ // ...
68+
69+ CustomModelWatcher::class => [
70+ 'enabled' => env('TELESCOPE_MODEL_WATCHER', true),
71+ 'events' => ['eloquent.*'],
72+ ],
73+
74+ // ...
75+
76+ ],
77+
78+ // ...
79+
80+ ];
81+ ```
82+
5183### Recommended (Optional) Custom Cache Store
5284If you would like to use a different cache store than the default one used by
5385your Laravel application, you may do so by setting the ` MODEL_CACHE_STORE `
Original file line number Diff line number Diff line change 1+ <?php namespace GeneaLabs \LaravelModelCaching \Telescope ;
2+
3+ use \Laravel \Telescope \Watchers \ModelWatcher as PackageWatcher ;
4+
5+ class ModelWatcher extends PackageWatcher
6+ {
7+ public function recordAction ($ event , $ data )
8+ {
9+ $ modifiedData = $ data ;
10+ $ modifiedData [0 ] = $ modifiedData [0 ] ?? $ modifiedData ['model ' ];
11+
12+ parent ::recordAction ($ event , $ modifiedData );
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments