<?php

namespace App\Events;

use Auth;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class OperationLoggedEvent implements ShouldQueue
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public $admin_id;
    public $ip;
    public $input;
    public $details;


    public function __construct($details = null)
    {
        $data = request()->all();
        unset($data['password']);

        $this->admin_id = Auth::id();
        $this->ip = request()->getClientIp();
        $this->input = $data;
        $this->details = $details;
    }
}
