Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart example throws exception #2712

Open
Liburia opened this issue Sep 12, 2023 · 4 comments
Open

Quickstart example throws exception #2712

Liburia opened this issue Sep 12, 2023 · 4 comments
Assignees
Labels

Comments

@Liburia
Copy link

Liburia commented Sep 12, 2023

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();

@surajtiwari06
Copy link

surajtiwari06 commented Sep 15, 2023

try instead $post->fill($request->get('post'))->save();

@Liburia
Copy link
Author

Liburia commented Sep 15, 2023

There is no $post anywhere in the scope, therefore, it understandably gives an undefined variable exception.

@tabuna
Copy link
Member

tabuna commented Sep 15, 2023

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.

@Liburia
Copy link
Author

Liburia commented Sep 24, 2023

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';
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants