Q: In laravel, i have a problem in toastr.php is "Using $this when not in object context". So can you help me to find out this  public function add($type, $message, $title = null, $options = [])
    {
        $types = ['error', 'info', 'success', 'warning'];

        if (! in_array($type, $types)) {
            throw new Exception("The $type remind message is not valid.");
        }

        $this->messages[] = [
            'type'    => $type,
            'title'   => $title,
            'message' => $message,
            'options' => $options,
        ];

        $this->session->flash('toastr::messages', $this->messages);
    }

In laravel, i  have a problem  in toastr.php is "Using $this when not in object context". So can you help me to find out this.
