Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nikhil_lu210's avatar

Multi Authentication Problem

I am working on a project where I have created Multi Authentication. Admin, Teacher & Student Panel. by the command of "php artisan make:auth" I have created the student authentication. And then I have duplicate all the files of auth related and customise them into two more authentications... now I wanna show the name of user (Student / Teacher / Admin) in the dashboard... in the student panel Dashboard I wrote "{{ Auth::user()->name }}" and its working... but in the teacher and admin is not working with this code... its showing error like this: "Trying to get property of non-object (View: C:\laragon\www\tManagement\resources\views\layouts\app-teacher.blade.php) (View: C:\laragon\www\tManagement\resources\views\layouts\app-teacher.blade.php)"

What can I do...??

0 likes
2 replies
MiguelBarros's avatar

@NIKHIL_LU210 can you be more specific in terms of code of how you implemented that? How is your config/auth.php file configuration ?

Please or to participate in this conversation.