Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Laravel 3 Site Model i can do somethink like that:
- public function adformats() {
- return $this->has_many_and_belongs_to('Adformat','sites_adformats')->with('zone_id');
- }
- In my Laravel 3 Controller i can do somethink like that:
- $site->adformats()->pivot()->where('site_id','=',$site->id)->where('adformat_id','=',$adformatid)->update(array('zone_id' => $zoneid));
- What do I need to do in Laravel 4?
- In My Model i do this:
- public function adformats() {
- return $this->belongsToMany('Adformat','sites_adformats')->withPivot('zone_id');
- }
- Is that right?
- How can access it now in Controller in Laravel 4?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement