12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace App\Http\Controllers;
- use Illuminate\Http\Request;
- use App\User;
- use App\StudentProposal;
- use App\Models\Department;
- use App\Models\ReferUser;
- use App\Models\University;
- use App\Institution;
- use App\Workexperience;
- use Auth;
- class TeacherHomeController extends Controller
- {
- public function __construct()
- {
- $this->middleware('teacher');
- }
- public function teacher_profile(Request $request)
- { $user = Auth::guard('teacher')->user();
- $students = StudentProposal::where(
- 'teacher_id',$user->id
- )->where(
- 'proposal_submit_status',1
- )->get();
- $departments =Department::where('status',1)->orderBy('name','ASC')->get();
-
- $refer_users =User::where(
- 'wishlist_teacher_id',$user->id
- )->whereIn(
- 'register_type',[3,4]
- )->orderBy('id','DESC')->get();
-
- $universities =University::orderBy('name','ASC')->get();
- return view('teacher_profile',compact('students','user','departments','refer_users','universities'));
- }
- public function student_proposal_details($id){
- $user = Auth::guard('teacher')->user();
- $proposal_details = StudentProposal::find($id);
- $education_history =Institution::where(
- 'student_id',$proposal_details->student_id
- )->orderBy('id','desc')->get();
- $experience =Workexperience::where(
- 'student_id',$proposal_details->student_id
- )->get();
- if(isset($experience)){
- $work_experince =[];
- foreach($experience as $key=>$row){
- array_push($work_experince,$row->start_date);
- array_push($work_experince,$row->end_date);
- }
- $start_date = current($work_experince);
- $end_date = end($work_experince);
- }
-
- return view('teacher.student_proposal_details',compact('proposal_details','education_history','start_date','end_date'));
- }
-
- }
|