master

laravel/framework

Last updated at: 29/12/2023 09:21

KeyWritten.php

TLDR

The KeyWritten.php file is a part of the Illuminate\Cache\Events namespace in the Demo Projects project. It defines a class called KeyWritten, which extends the CacheEvent class. This class represents an event when a key is written to the cache.

<?php

namespace Illuminate\Cache\Events;

class KeyWritten extends CacheEvent
{
    /**
     * The value that was written.
     *
     * @var mixed
     */
    public $value;

    /**
     * The number of seconds the key should be valid.
     *
     * @var int|null
     */
    public $seconds;

    /**
     * Create a new event instance.
     *
     * @param  string  $key
     * @param  mixed  $value
     * @param  int|null  $seconds
     * @param  array  $tags
     * @return void
     */
    public function __construct($key, $value, $seconds = null, $tags = [])
    {
        parent::__construct($key, $tags);

        $this->value = $value;
        $this->seconds = $seconds;
    }
}