{"action":"closed","issue":{"url":"https://api.github.com/repos/laravel/nova-issues/issues/867","repository_url":"https://api.github.com/repos/laravel/nova-issues","labels_url":"https://api.github.com/repos/laravel/nova-issues/issues/867/labels{/name}","comments_url":"https://api.github.com/repos/laravel/nova-issues/issues/867/comments","events_url":"https://api.github.com/repos/laravel/nova-issues/issues/867/events","html_url":"https://github.com/laravel/nova-issues/issues/867","id":372202701,"node_id":"MDU6SXNzdWUzNzIyMDI3MDE=","number":867,"title":"Relationship Names, NULLS and Date Formats","user":{"login":"arjasco","id":8780549,"node_id":"MDQ6VXNlcjg3ODA1NDk=","avatar_url":"https://avatars3.githubusercontent.com/u/8780549?v=4","gravatar_id":"","url":"https://api.github.com/users/arjasco","html_url":"https://github.com/arjasco","followers_url":"https://api.github.com/users/arjasco/followers","following_url":"https://api.github.com/users/arjasco/following{/other_user}","gists_url":"https://api.github.com/users/arjasco/gists{/gist_id}","starred_url":"https://api.github.com/users/arjasco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjasco/subscriptions","organizations_url":"https://api.github.com/users/arjasco/orgs","repos_url":"https://api.github.com/users/arjasco/repos","events_url":"https://api.github.com/users/arjasco/events{/privacy}","received_events_url":"https://api.github.com/users/arjasco/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-20T11:39:44Z","updated_at":"2018-10-24T07:56:10Z","closed_at":"2018-10-24T07:56:10Z","author_association":"NONE","body":"<!-- If this is a question and not a bug, it will be closed and responded to with links -->\r\n<!-- Visit https://laracasts.com/discuss/channels/nova for questions -->\r\n\r\n- Laravel Version: 5.7.9\r\n- Nova Version: 1.1.4\r\n- PHP Version: 7.2.3\r\n\r\n### Description:\r\n\r\nI sent a support email over a week ago but had no reply so checking if anyone can help here or knows a workaround.\r\n\r\nThere is a couple of bugs that i have come across which would be great to get sorted. These are inconsistencies i can live with as a developer but nova is going to be extremely useful for internal staff to manage the data for a bespoke customer front-facing build. These inconsistencies will be confusing to these non developers.\r\n\r\n1. NULL relationships are possible and they do work if you just hit save without selecting an item from a relationship dropdown. However if a selection is made there is no way to revert back to a \"None\" option. Could this be a configuration option? something like `->nullable('None Label')` on the field type?\r\n\r\n2. Changing relationship labels only reflects on index and details screens. .eg a User relationship might exist but in business logic it is something completely different.. \"Booked By\", \"Added By\", \"Sales Person\" etc. Which would represent a user. Here I have a Organisation which can have a Parent Organisation (nullable too, which relates back to point 1).\r\n\r\n![labels](https://user-images.githubusercontent.com/8780549/47255068-d9c12f00-d462-11e8-91c3-667ae7ad3d6c.png)\r\n\r\n3. Setting a date format only reflects on index and details screen. This is confusing, especially those from countries that don't use the Y-M-D format. While building the form elements i genuinely thought the `->format()` method was doing nothing till I noticed it only applies on the index/details screens.\r\n\r\n<img width=\"484\" alt=\"date-format\" src=\"https://user-images.githubusercontent.com/8780549/47255094-68ce4700-d463-11e8-91a3-de2a2b15536f.png\">\r\n\r\n\r\n### Steps To Reproduce:\r\nAdd a relationship field to a Resource (in this case BelongsTo) with a different name by setting the additional attributes in this case the underlying resource is `Organisation`\r\n\r\n```php\r\nBelongsTo::make('Parent Organisation', 'parent', self::class),\r\n```\r\n\r\nOrganisation model parent relationship:\r\n\r\n```php\r\npublic function parent()\r\n{\r\n    return $this->belongsTo(Organisation::class, 'parent_id');\r\n}\r\n```\r\n\r\nSee that name only reflects on index/details and the dropdown field itself, also see no option to revert back to a nullable state.\r\n\r\n\r\nAdd a date field with a custom moment.js format\r\n\r\n```php\r\nDate::make('Date')->format('DD/MMM/YYYY')->sortable(),\r\n```\r\n\r\nSee that format only reflects on index/details\r\n\r\n\r\n"}}
{"actor":{"display_login":"davidhemphill"}}