Skip to content

[Eloquent] $fillable and firstOrNew/firstOrCreate dont use set mutators #5578

@wjaspers

Description

@wjaspers

If the model I've defined has a DateTime property and the fillable attribute is not identical to the physical column name, firstOrNew and firstOrCreate dont know how to handle the property.

I also noticed the setXAttribute() methods are never called during the lookup phase. Is there a specific reason the model is not filled first, and the Select query generated from its properties?

Example code & log output: https://gist.github.com/wjaspers/bb8f9cf0a4a7e169b7e9

I'm using Laravel 4.1

[ErrorException]
Object of class DateTime could not be converted to string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions