has-many-polymorphs Questions
0
How can I add, delete and get a favorite from product with polymorphic relationship, in Laravel 5.6?
My product model like this :
<?php
...
class Product extends Model
{
...
protected $fillable = ['name','photo','description',...];
public function favorites(){
return $this->morphMany(F...
Beard asked 27/3, 2018 at 12:32
1
I have the following models. Users have UserActions, and one possible UserAction can be a ContactAction (UserAction is a polymorphism). There are other actions like LoginAction etc. So
class Use...
Enthronement asked 3/11, 2010 at 10:16
2
Solved
I'm pretty new to Rails, and i'm trying to do a polymorphic HABTM relationship. The problem is that I have three models that I want to relate.
The first one is the Event model and then are two kin...
Vins asked 6/8, 2011 at 4:6
1
Solved
I got some Manager and SoccerTeam model. A manager "owns" many soccer teams; also a manager can comment on soccer teams and can comment on other managers too:
manager.rb
# Soccer teams the manage...
Frontage asked 19/2, 2011 at 18:12
1
© 2022 - 2024 — McMap. All rights reserved.