laravel-favorite
                                
                                
                                
                                    laravel-favorite copied to clipboard
                            
                            
                            
                        [Request] Morphable favouriter?
Currently we only allow a 'user' to favourite a model, would it be possible in the future to allow many models to favourite many models?
For example:
- User::class can favourite Status::class
 - Page::class can favourite Image::class
 - Page::class can favourite Status::class
 
Hello, thanks for the suggestion, but I still don't quite understand how non-human behavior can have the action " favorite ", it is not a technical problem, but the question of whether it is necessary or not, is there a more realistic scenario?
Let's take facebook for example
Pages (https://www.facebook.com/facebookUK/?brand_redir=20531316728) can perform actions when logged in as a page...
@natecorkish I think you can create a User variant to implement it. For example, add a field to mark this User as a Page using: type:page.
Or add a parent_id to the User model:
user A has two pages:
users:
| id | nickname | parent_id | 
|---|---|---|
| 1 | A | 0 | 
| 2 | Page1 | 1 | 
| 3 | Page2 | 1 | 
pages:
| ID | user_id | name | 
|---|---|---|
| 1 | 2 | Page1 | 
| 2 | 3 | Page2 |