forked from dysath/seat-fitting
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add events when fitting and doctrines change (#3)
seat-inventory needs to update some stuff when a fitting changes. I tried to use an observer for this, but: The plugin first saves the fitting and only afterwards save the items of the fit, meaning the observer fires before the items of a fitting have been saved. This PR adds a laravel event that fires after a fitting has been saved. The same has been done with doctrines for the same reason. This PR depends on eveseat/services#180
- Loading branch information
Showing
5 changed files
with
82 additions
and
32 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,22 @@ | ||
<?php | ||
|
||
namespace CryptaTech\Seat\Fitting\Events; | ||
|
||
use CryptaTech\Seat\Fitting\Models\Doctrine; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class DoctrineUpdated | ||
{ | ||
use Dispatchable, SerializesModels; | ||
|
||
public Doctrine $doctrine; | ||
|
||
/** | ||
* @param Doctrine $doctrine | ||
*/ | ||
public function __construct(Doctrine $doctrine) | ||
{ | ||
$this->doctrine = $doctrine; | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace CryptaTech\Seat\Fitting\Events; | ||
|
||
use CryptaTech\Seat\Fitting\Models\Fitting; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class FittingUpdated | ||
{ | ||
use Dispatchable, SerializesModels; | ||
|
||
public Fitting $fitting; | ||
|
||
/** | ||
* @param Fitting $fitting | ||
*/ | ||
public function __construct(Fitting $fitting) | ||
{ | ||
$this->fitting = $fitting; | ||
} | ||
} |
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