Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dispatching event when deleting user submission (#17)
* dispatching event when deleting user submission * extra test * extra test --------- Co-authored-by: dawid.miklas <dawid.miklas@escolasoft.com>
- Loading branch information
Showing
4 changed files
with
127 additions
and
2 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,32 @@ | ||
<?php | ||
|
||
namespace EscolaLms\AssignWithoutAccount\Events; | ||
|
||
use EscolaLms\Cart\Models\Product; | ||
use EscolaLms\Core\Models\User; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class UnassignProduct | ||
{ | ||
use Dispatchable, SerializesModels; | ||
|
||
private User $user; | ||
private Product $product; | ||
|
||
public function __construct(User $user, Product $product) | ||
{ | ||
$this->user = $user; | ||
$this->product = $product; | ||
} | ||
|
||
public function getUser(): User | ||
{ | ||
return $this->user; | ||
} | ||
|
||
public function getProduct(): Product | ||
{ | ||
return $this->product; | ||
} | ||
} |
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,32 @@ | ||
<?php | ||
|
||
namespace EscolaLms\AssignWithoutAccount\Events; | ||
|
||
use EscolaLms\Cart\Contracts\Productable; | ||
use EscolaLms\Core\Models\User; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class UnassignProductable | ||
{ | ||
use Dispatchable, SerializesModels; | ||
|
||
private User $user; | ||
private Productable $productable; | ||
|
||
public function __construct(User $user, Productable $productable) | ||
{ | ||
$this->user = $user; | ||
$this->productable = $productable; | ||
} | ||
|
||
public function getUser(): User | ||
{ | ||
return $this->user; | ||
} | ||
|
||
public function getProductable(): Productable | ||
{ | ||
return $this->productable; | ||
} | ||
} |
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