-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger searchable when records are updated. (#1699)
There are numerous places in the panel, like relationship managers, which don't trigger it's owner record's Observers and as a consequence it's not always clear if a searchable record has been updated on the index. Whilst the use of observers will still work this PR looks to also hook into various `after` triggers in the panel to manually call `searchable` on the affected model.
- Loading branch information
1 parent
f02eb78
commit 3e85ee9
Showing
30 changed files
with
498 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ChildCollectionCreated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class CollectionProductAttached | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class CollectionProductDetached | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class CustomerAddressEdited | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class CustomerUserEdited | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ModelChannelsUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ModelMediaUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ModelPricesUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ModelUrlsUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ProductAssociationsUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ProductCollectionsUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/admin/src/Events/ProductCustomerGroupsUpdated.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ProductCustomerGroupsUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ProductPricingUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/admin/src/Events/ProductVariantOptionsUpdated.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Lunar\Admin\Events; | ||
|
||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ProductVariantOptionsUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Model $model | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.