FEATURE: prepare logging for settings (once it will exist)

This commit is contained in:
Michal Kváček
2016-01-29 00:37:45 +01:00
parent 4a8facc046
commit b3c543f06c
3 changed files with 58 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace App\Events;
use App\Events\Event;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class ChangeSettings extends Event
{
use SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct()
{
//
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Listeners;
use App\Events\ChangeSettings;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class LogChangeSettings extends Logger
{
/**
* Handle the event.
*
* @param ChangeSettings $event
* @return void
*/
public function handle(ChangeSettings $event)
{
$parameters = [];
$this->saveLog($parameters);
}
/**
* Getter for action name. Used only internally
*
* @return mixed
*/
protected function getName()
{
return 'changeSettings';
}
}
+3
View File
@@ -28,6 +28,9 @@ class EventServiceProvider extends ServiceProvider
'App\Events\DeleteCustomField' => [
'App\Listeners\LogDeleteField',
],
'App\Events\ChangeSettings' => [
'App\Listeners\LogChangeSettings',
],
// internal Laravel events - should work as auth.login and auth.logout, however it doesn't...
'Illuminate\Auth\Events\Login' => [
'App\Listeners\LogLogin'