Level 18
$paper = Paper::where([
['paper_type', 'PaperSolution'],
['class', Auth::user()->class]
])->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I had an admin panel where 3 types of user are there Admin, Teacher and Student. Now i want that when student logged in he/she only see data uploaded by admin according to his/her class and class group like class=10th and group=computer science. I have no idea how can i get this type of thing. I had used following code
$paper = Paper::where('paper_type','PaperSolution' && 'class',Auth::user()->class)->get();
this is not working properly as i am dumping data
dd($paper);
it is giving me null as answer.
Please or to participate in this conversation.