marvinlabs / laravel-discord-logger

Logging to a discord channel in Laravel
MIT License
176 stars 41 forks source link

Laravel 10.x Compatibility #33

Closed laravel-shift closed 1 year ago

laravel-shift commented 1 year ago

This is an automated pull request from Shift to update your package code and dependencies to be compatible with Laravel 9.x.

Before merging, you need to:

If you do find an issue, please report it by commenting on this PR to help improve future automation.

laravel-shift commented 1 year ago

:alembic: Using this package? If you would like to help test these changes or believe them to be compatible, you may update your project to reference this branch.

To do so, temporarily add Shift's fork to the repositories property of your composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/laravel-shift/laravel-discord-logger.git"
        }
    ]
}

Then update your dependency constraint to reference this branch:

{
    "require": {
        "marvinlabs/laravel-discord-logger": "dev-l10-compatibility",
    }
}

Finally, run: composer update

fh32000 commented 1 year ago

@laravel-shift good job

svpernova09 commented 1 year ago

@laravel-shift good bot. Cheers!

sgtcoder commented 1 year ago

To fix the issue with:

Declaration of MarvinLabs\DiscordLogger\LogHandler::write(array $record): void must be compatible with Monolog\Handler\AbstractProcessingHandler::write(Monolog\LogRecord $record): void

I updated this file: MarvinLabs\DiscordLogger\LogHandler with the following

use Monolog\LogRecord;

public function write(LogRecord $record): void
    {
        $record = $record->toArray();

        foreach ($this->recordToMessage->buildMessages($record) as $message) {
            $this->discord->send($message);
        }
    }
Bmohsen commented 1 year ago

To fix the issue with:

Declaration of MarvinLabs\DiscordLogger\LogHandler::write(array $record): void must be compatible with Monolog\Handler\AbstractProcessingHandler::write(Monolog\LogRecord $record): void

I updated this file: MarvinLabs\DiscordLogger\LogHandler with the following

use Monolog\LogRecord;

public function write(LogRecord $record): void
    {
        $record = $record->toArray();

        foreach ($this->recordToMessage->buildMessages($record) as $message) {
            $this->discord->send($message);
        }
    }

thank you, just saved my day.