Anyone know how to do something like this?
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
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community