Sign in
Log inSign up

How can I implement multi-table for users in Laravel in such a way that I can have many models example: (Admin, Student and Teacher)?

rct's photo
rct
·May 27, 2016

Currently there's only one table that Laravel uses, the users table and the User model. I want to have Teacher model and Student as well with corresponding tables (teachers and students) so that I can do 1 to many relationships like $teacher->students, or $students->teacher. I want to accomplish multi-auth and multi model users in Laravel. Thanks.

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct