zalazdi

CompanyActionLogHandler.php

Mar 25th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Listeners;
  4.  
  5. use App\Events\CompanyActionlog;
  6. use Illuminate\Queue\InteractsWithQueue;
  7. use Illuminate\Contracts\Queue\ShouldQueue;
  8.  
  9. class CompanyActionlogHandler extends Handler
  10. {
  11.     /**
  12.      * Create the event listener.
  13.      */
  14.     public function __construct()
  15.     {
  16.         parent::__construct();
  17.     }
  18.  
  19.     /**
  20.      * Handle the event.
  21.      *
  22.      * @param  CompanyActionlog  $event
  23.      * @return void
  24.      */
  25.     public function handle(CompanyActionlog $event)
  26.     {
  27.         if ($this->checkSpamFilter($event)) {
  28.             $this->log->create([
  29.                 'name' => $event->name,
  30.                 'details' => $this->compileDetails($event),
  31.                 'user_id' => $this->sentinel->getUser()->id, // action belongs to
  32.             ]);
  33.  
  34.             $this->createSpamFilter($event);
  35.         }
  36.     }
  37. }
Add Comment
Please, Sign In to add comment