Skip to content

Not compatible with PHP 8.4 #65

@joostdebruijn

Description

@joostdebruijn

After switching to PHP 8.4 I get the following message: PHP Deprecated: DateTimeImmutable::format(): Passing null to parameter #1 ($format) of type string is deprecated. This deprecation happens in src/Models/LogToDbCreateObject.php on line 57 when running it with PHP 8.4. It's a bit weird, because at that line config('logtodb.datetime_format') is called and it returns null. However, I don't have the logtodb config file published, so I would expect it will use the defaults from the package, but it seems that doesn't happen.

When I fix this, this package still doesn't work on PHP 8.4. I receive another error: CRITICAL: There was an error while trying to write the log to a DB, log record pushed to error_log() {"exception":{"message":"Call to a member function connection() on null","code":0,"file":"[...]/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php","line":1850}}.

Not sure what goes wrong here after upgrading to PHP 8.4. Maybe I've some time later this week to dive into it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions