Support the ongoing development of Laravel.io →
Eloquent Packages
Last updated 1 year ago.
0

Anyone know how to do something like this?

Last updated 1 year ago.
0

Any reason that auto hydrate wouldn't work?

I get all my "field required" errors when printing out the error message i.e.

    $r = new XRegistrant();
    if(!$r->save()){
        print_r($r->errors()->all());exit;
    }

Once I manually set a field

    $r->locale = "fred";

That fields "required" error goes away, which shows its a auto hydrate issue. I do of course have auto hydrate set to true

class XRegistrant extends \LaravelBook\Ardent\Ardent {

// Auto Hydrate
public $autoHydrateEntityFromInput = true;
public $forceEntityHydrationFromInput = true;
public $autoPurgeRedundantAttributes    = true;

Thanks

0

I found issue - I am using fiddler for posting to the controller. I needed to set

Content-Type: application/x-www-form-urlencoded

Which fixed the issue.

Opps

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.