[英]ErrorException Trying to get property of non-object
Hi here I got these following errors: 您好,我得到了以下错误:
at HandleExceptions->handleError(8, 'Trying to get property of non-object', 'C:\\wamp64\\www\\gesetud\\app\\Http\\Controllers\\FeeController.php', 99, array('viewName' => 'fee.payment', 'student_id' => '4', 'feetypes' => object(Collection), 'status' => null))in FeeController.php (line 99)
at FeeController->payment('fee.payment', '4')in FeeController.php (line 124)
when using this Route 使用此路线时
Route::get('/etudiant/aller/a/payement/{student_id}',['as'=>'goPayment','uses'=>'FeeController@goPayment']);
here the 'goPayment' method line 124: 这是“ goPayment”方法行124:
public function goPayment($student_id)
{
return $this->payment('fee.payment',$student_id);
}
And here line 99 is $programs=Programme::where....: 第99行是$ programs = Programme :: where ....:
public function payment($viewName,$student_id)
{
$feetypes = FeeType::all();
$status = $this->student_status($student_id);
$programs = Programme::where('program_id',$status->program_id)->get();
$levels = Niveau::where('program_id',$status->program_id)->get();
$studentfee = $this->show_school_fee($status->level_id)->first();
$readStudentFee = $this->read_student_fee($student_id)->get();
$readStudentTransaction = $this->read_student_transaction($student_id)->get();
$receipt_id = ReceiptDetail::where('student_id',$student_id)->max('receipt_id');
return view($viewName,compact('programs',
'levels',
'status',
'studentfee',
'receipt_id',
'readStudentFee',
'readStudentTransaction',
'feetypes'))
->with('student_id',$student_id);
here student_status function: 这里student_status函数:
public function student_status($studentId)
{
return Status::latest('statuses.status_id')
->join('students','students.student_id','=','statuses.student_id')
->join('classes','classes.class_id','=','statuses.class_id')
->join('academics','academics.academic_id','=','classes.academic_id')
->join('shifts','shifts.shift_id','=','classes.shift_id')
->join('times','times.time_id','=','classes.time_id')
->join('groups','groups.group_id','=','classes.group_id')
->join('batches','batches.batch_id','=','classes.batch_id')
->join('levels','levels.level_id','=','classes.level_id')
->join('programs','programs.program_id','=','levels.program_id')
->where('students.student_id',$studentId)
->first();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.