Initial commit
This commit is contained in:
23
app/Observers/BankObserver.php
Normal file
23
app/Observers/BankObserver.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\Bank;
|
||||
|
||||
class BankObserver
|
||||
{
|
||||
/**
|
||||
* Handle the Bank "created" event.
|
||||
* Automatically register new Banks as love reacters and reactables.
|
||||
*/
|
||||
public function created(Bank $bank): void
|
||||
{
|
||||
if (!$bank->isRegisteredAsLoveReacter()) {
|
||||
$bank->registerAsLoveReacter();
|
||||
}
|
||||
|
||||
if (!$bank->isRegisteredAsLoveReactant()) {
|
||||
$bank->registerAsLoveReactant();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user