Can you show the code in your controller ?
Are the title and content values equal To null in the controller ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When using a mysql db as my testing database this works fine:
public function test_draft_autosave_endpoint()
{
$this->logUserIn();
$draft = $this->user->draft()->create([]);
$this->assertNull($draft->title);
$this->assertNull($draft->body);
$title = 'A title';
$body = '<div> some engaging content here.</div>';
$this->post(route('autosave.draft', $draft), [
'title' => $title,
'content' => $body
]);
$draft = Draft::find($draft->id);
$this->assertEquals($draft->title, $title);
$this->assertEquals($draft->body, $body);
}
However, in sqllite inmemory database this fails. The $draft's title and body attributes equal null. I believe this is because I am calling an api route and the inmemory db has no access to the changes made via that? Anyone ever dealt with something like this before?
Please or to participate in this conversation.