<?php namespace App\Http\Controllers; use App\Models\{AttendanceRecord,Task,ProjectMember,Announcement}; class InternPortalController extends Controller { public function dashboard(){ $u=request()->user(); return view('portal.intern',['intern'=>$u->intern,'attendance'=>AttendanceRecord::where('user_id',$u->id)->whereDate('work_date',today())->first(),'tasks'=>Task::where('primary_assignee_id',$u->id)->whereNotIn('status',['completed','cancelled'])->orderBy('due_date')->limit(8)->get(),'projects'=>ProjectMember::with('project')->where('user_id',$u->id)->whereNull('end_date')->get(),'announcements'=>Announcement::where('is_active',true)->whereIn('audience',['all','interns'])->latest('published_at')->limit(5)->get()]); } }