Hello, all. Rank beginner here, but really enjoying the Cockpit experience overall so far.
I’m trying to add entries to a collection using PHP and the bootstrap.php methods, but I fear I have the syntax wrong somewhere.
Here is my attempt:
echo "<h1> TITLE: ". $posts . "</h1>"; $return = cockpit('collections')->save('blog', [ 'data' => [ 'published' => true, 'slug' => $posts, 'date' => $posts, 'title' => $posts, 'image' => [ 'path' => $posts ], 'excerpt' => $posts, 'content' => $posts ] ]);
I get an error back that the title is required (it is), but I output the title above and it looks fine. Any help is greatly appreciated!