PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 All 50 releases
fluent-cart / app / Events / ReviewCreated.php

ReviewCreated.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.7.0, at app/Events/ReviewCreated.php

40 lines 740 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Events;
4
5 use FluentCart\App\Models\ProductReview;
6
7 class ReviewCreated extends EventDispatcher
8 {
9 public string $hook = 'fluent_cart/review_created';
10
11 protected array $listeners = [];
12
13 public ProductReview $review;
14
15 public function __construct(ProductReview $review)
16 {
17 $this->review = $review;
18 }
19
20 public function toArray(): array
21 {
22 $this->review->load('product');
23
24 return [
25 'review' => $this->review,
26 'product' => $this->review->product,
27 ];
28 }
29
30 public function getActivityEventModel()
31 {
32 return $this->review;
33 }
34
35 public function shouldCreateActivity(): bool
36 {
37 return false;
38 }
39 }
40