orchidsoftware / orchidsoftware/platform

error try to add attachment relation through model

Open
#2,487 1 comment 0 reactions 1 assignee View on GitHub

@tabuna is already working on this.

Since Jan 2, 2023.

Errors
Dominant language
PHP
Stars
4.8k
Forks
662
Avg merge
1d 9h
Merged PRs (30d)
7

Description

Describe the bug
I try to create a sample for using attachments. I use all steps from https://orchid.software/en/docs/attachments/ and https://orchid.software/en/docs/quickstart-files/. If i a the following to the Model "post", i can't add a post anymore. The page only shows a white page. Create and edit does not work anymore.

public function hero()
{
     return $this->hasOne(Attachment::class, 'id', 'hero')->withDefault();
}		

To Reproduce
Create all files described at https://orchid.software/en/docs/quickstart-crud/. Add attachment support. https://orchid.software/en/docs/quickstart-files/. After that add relation to model described here https://orchid.software/en/docs/attachments/#remove.

After adding the relation the create/edit page could not be loaded anymore. Without the releation the page is ok.

I don't see the error. Any tipps for me?

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Version 108.01

Server (please complete the following information):

  • Plattform Version: 13.9.1
  • Laravel Version: 9.45.1
  • PHP Version: 8.0.26
  • Database: [MySql
  • Database Version: 15.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.