Giter Site home page Giter Site logo

nova-hasmany-bug's Introduction

Nova HasMany relationship bug

This repository display the laravel nova bug when there is two HasMany relationships to the same model.

Setup

composer install

vendor/bin/sail up -d

vendor/bin/sail artisan migrate:fresh --seed

Login

Login with email [email protected] and password password

Bug explanation

If you ran the seeder it should already have all data you need.

This repository contains of a user that can belong to many teams. The TeamUser pivot/model has a role which is used to filter between admins and members.

The Team model has two HasMany relationships to TeamUser admins() and members(), the difference is the filteration on the role column.

Now navigate to the teams resource and go to the detail page of the team.

Click on Create Team User for admins. You can see that the Team relationship is automatically filled with the correct team.

Now go back.

Click on Create Team User for members. You can see that the Team relationship is empty for some reason.

Now go to the file app/Nova/Team.php move the members relationship above the admin relationship, and repeat the steps above.

Then you will see the same result but flipped, so it seems like the autofill only works for the first relationship.

nova-hasmany-bug's People

Contributors

youneselbarnoussi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.