You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason of this it is because I will like to add a Polymorphic relationships to the user model and allow users access their profile table according the user type selected when registering! Example of this will be a user type model and a user type agency both has a profile page with different columns to input in their profiles, etc...
Thanks for any tips!
The text was updated successfully, but these errors were encountered:
is it possible to use Polymorphic relationships with Craftable Pro, to have cleaner and simpler merging of relations and using the CRUD generator?
Example:
Schema:
$table->morphs(‘commentable’);
In the model Post Model
‘‘‘
public function comments()
{
return $this->morphMany('App\Comment', 'commentable');
}
‘‘‘
In the model Page Model
‘‘‘
public function comments()
{
return $this->morphMany('App\Comment', 'commentable');
}
‘‘‘
In the comment Page Model
‘‘‘
public function commentable()
{
return $this->morphTo();
}
‘‘‘
A sample of this is found here:
https://blog.logrocket.com/polymorphic-relationships-laravel/
The reason of this it is because I will like to add a Polymorphic relationships to the user model and allow users access their profile table according the user type selected when registering! Example of this will be a user type model and a user type agency both has a profile page with different columns to input in their profiles, etc...
Thanks for any tips!
The text was updated successfully, but these errors were encountered: