Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Validate mutator "aliases" #81

@ortzinator

Description

@ortzinator

I'm currently trying to validate input that is not going directly into the model. The model has a expires_at DateTime column and the user inputs the number of days they would like it to expire after and the math is done to arrive at a future date.

I can use a setDaysAttribute mutator to transform the days into a date, and I can even set an attribute with $this->attributes['days'] so that it will be validated but then Eloquent is confused and tries to insert a "days" column into the database where none exists.

I'm not sure how this would be implemented but I don't see a solution other than validating "days" in the controller or adding a "days" column to the database.

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