<?php

namespace App\Listeners;

use App\Events\MessageButton;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class CreateMessage
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  MessageButton  $event
     * @return void
     */
    public function handle(MessageButton $event)
    {
        session(['last_page' => $event->page]); 
        session(['last_time' => date('Y-m-d H:i:s')]); 
    }
}
