php - Many to Many relationships laravel -mongo -


Hi I'm a newbie in Laravel and Mongod. I write some relationships about the team, user and board in many relationships. I am But it is not working! What should I do in the controller.

(I use jenssegers / laravel-mongodb))

The connection is user 1 .. * --- * Team * ---- 1. * Board

User (model)

  Extension of class user ... Public function teams () {Return $ this- & gt; Affiliation Value ('Team', Blank, 'Team Member', 'Team'); }  

board (model)

  increases class taskbar ... public function teams () {return $ this- & gt; Affiliation Value ('Team', Null, 'Taskboard', 'Team'); }  

Team (model)

  Expanding the class team ... Public Function Team Members () {Return $ this- & gt; Affiliation Value ('user', blank, 'team', 'team member'); } Public Function Executive () {Return $ this- & gt; Related toman ('taskboard', empty, 'team', 'taskboard'); }  

Controller Team // OK work!

  Public function store () {$ team = new team; $ Team- & gt; Name = input :: get ('teamname'); $ Team- & gt; Master = at :: user () - & gt; _id; $ Team = at :: user () - & gt; Teams () - & gt; Save ($ Team); // OK just work! $ Team & gt; Save (); Return Redirect :: Way ('Main'); }  

Controller Board // There is a problem

  Public Function Store () {$ TaskBoard = New TaskBoard; $ Taskbar- & gt; Name = input :: get ('boardname'); $ Taskbar- & gt; Teams = input: get ('team'); $ TaskBoard = Ath :: User () - & gt; Teams () - & gt; Save (TaskBoard); // Not working! What should I do to store boards in team returns Redirect :: Way ('main'); }  


Comments