jeudi 26 août 2021

Laravel array column stops at 16?

I have a text column in Laravel which is casted as an array, like so:

    protected $casts = [
        'onboarded_enums' => 'array',
    ];

For whatever reason, it maxes out at 16 items. I can push new ones onto it and save the model instance, and another gets removed. There's nothing fancy in the logic or anything, it just seems to bump one off when adding more than 16:

    public function setOnboardingStep(Request $request){
        $user = JWTAuth::parseToken()->authenticate();  

        $onboarded_enums = $user->onboarded_enums ? : [];

        if(!in_array($request->type, $onboarded_enums)){
            $onboarded_enums[] = $request->type;
        }

        $user->onboarded_enums = $onboarded_enums;

        $user->save();

        return $user;
    }

Has anyone experienced this before? I've Googled around relentlessly about it, but I can't see anything useful.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire