platform
platform copied to clipboard
Quickstart example throws exception
https://orchid.software/en/docs/quickstart-crud/
When trying to create a post, I get an exception Call to a member function fill() on null
at line $this->post->fill($request->get('post'))->save();
try instead $post->fill($request->get('post'))->save();
There is no $post
anywhere in the scope, therefore, it understandably gives an undefined variable exception.
Hello, I'm sorry to inform you that the issue has been poorly documented and lacks the necessary data that could be of assistance, such as the package version.
In case the value of $post
is null, it is highly probable that you have either not defined a public property or are using previous versions of the package.
Hello.
I am using "orchid/platform": "^14.0"
and the Screen's content is a straight copy-paste from the docs page.
public $post;
is defined. Moreover, the post injection works properly in the name method.
public function name(): ?string
{
return $this->post->exists ? 'Edit post' : 'Creating a new post';
}