I'm reworking a project on Laravel 5.1
What I realize is that the old classes have become much complicated and do not really follow the 'single responsibility' principle anymore.
So I'm planning to do such:
<?php
class User extends Model
{
}
class SocialUser extends User
{
}
So I have a few questions,
- Is it possible to achieve that?
- If yes, then does the SocialUser class link back to the same database table which is Users and would it conflict with the User model itself?
- Is this all a good design practice at the first place? Or I better make use of traits?
Thank you.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire