generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect after accept consents and events & notifications
- Loading branch information
1 parent
e022739
commit cfb9f22
Showing
9 changed files
with
267 additions
and
69 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Ekoukltd\LaraConsent\Listeners; | ||
|
||
use Ekoukltd\LaraConsent\Events\ConsentUpdated; | ||
use Illuminate\Support\Facades\Auth; | ||
use Illuminate\Support\Facades\Log; | ||
|
||
class LogConsentUpdated | ||
{ | ||
public function handle(ConsentUpdated $event) | ||
{ | ||
if (($event->consentOption->is_mandatory&&config('laraconsent.logging.mandatory')) | ||
||(!$event->consentOption->is_mandatory&&config('laraconsent.logging.optional')) | ||
){ | ||
$status = $event->accepted?'accepted':'refused'; | ||
Log::info("Consent: ".$event->consentOption->key." $status by ".Auth::user()->email); | ||
} | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace Visualbuilder\FilamentUserConsent\Listeners; | ||
|
||
use Illuminate\Support\Facades\Auth; | ||
use Illuminate\Support\Facades\Log; | ||
use Visualbuilder\FilamentUserConsent\Events\ConsentsUpdatedComplete; | ||
use Visualbuilder\FilamentUserConsent\Notifications\ConsentsUpdatedNotification; | ||
|
||
class NotifyConsentsUpdated | ||
{ | ||
public function handle(ConsentsUpdatedComplete $event) | ||
{ | ||
$event->user->notify(new ConsentsUpdatedNotification()); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Visualbuilder\FilamentUserConsent\Mail; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ConsentsUpdatedMail extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
|
||
protected $user; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($user) | ||
{ | ||
$this->user = $user; | ||
} | ||
|
||
/** | ||
* Build the message. | ||
* | ||
* @return $this | ||
*/ | ||
public function build() | ||
{ | ||
|
||
} | ||
} |
Oops, something went wrong.