From 30dc7f908fcf382911c2ed3c77af3b5a12360c7f Mon Sep 17 00:00:00 2001 From: zhwei Date: Fri, 10 Nov 2017 09:35:52 +0800 Subject: [PATCH] fix type hint error when saving subclass instance --- src/Searchable.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Searchable.php b/src/Searchable.php index 82ab12d..f3425cd 100644 --- a/src/Searchable.php +++ b/src/Searchable.php @@ -46,13 +46,15 @@ trait Searchable */ public static function bootSearchable() { - static::saved(function (self $model) { + static::saved(function ($model) { + /** @var static $model */ if ($model->shouldSyncDocument()) { $model->document()->save(); } }); - static::deleted(function (self $model) { + static::deleted(function ($model) { + /** @var static $model */ if ($model->shouldSyncDocument()) { $model->document()->delete(); }