Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Question - Should I still have a fk defined $casts? #81

Closed
louisl opened this issue Oct 23, 2018 · 2 comments
Closed

Question - Should I still have a fk defined $casts? #81

louisl opened this issue Oct 23, 2018 · 2 comments

Comments

@louisl
Copy link
Contributor

louisl commented Oct 23, 2018

I'm converting a schema to use uuids.

In my model I have

    /**
     * Casts
     *
     * @var array
     */
    protected $casts = [
        'country_id' => 'int',
    ];

I see in the readme that I should add

    /**
     * The binary UUID attributes that should be converted to text.
     *
     * @var array
     */
    protected $uuids = [
        'country_uuid' // foreign or related key
    ];

So I'm removing the column country_id and replacing it with country_uuid.

The question is, do I need to define that in any way in $casts or is that replaced for uuids by the $uuids array?

@vpratfr
Copy link
Collaborator

vpratfr commented Oct 23, 2018

No need to have that in $casts. Just in $uuids

@vpratfr vpratfr closed this as completed Oct 23, 2018
@louisl
Copy link
Contributor Author

louisl commented Oct 23, 2018

Thank you, maybe stick that in the readme for clarity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants