php - Laravel 5.3 Different Fields Per User Role Type how to implement this using polymorphism? -
title says all
for example
i want main laravel user model have different kinds of roles , every role
has different fields
example
user has role of employee
where role have different fields user
you don't need use polymorphism here. user
model used laravel so, should keep similar data in model. create employee
, other models. should add one one relation between user
, other models.
class user extends model { public function employee() { return $this->hasone('app\employee'); } }
Comments
Post a Comment