app/DataTables/students/AbsencesDataTable.php
/**
     * Get query source of dataTable.
     *
     * @param \App\Models\students/Absence $model
     * @return \Illuminate\Database\Eloquent\Builder
     */
Get query source of dataTable.
Get query source of dataTable .
public function query(Absences $model)
    {
        return $model->query()
            ->join('students', 'students.id', '=', 'absences.student_id')
            ->join('meetings', 'meetings.id', '=', 'absences.meeting_id')
            ->where('meetings.subject_id', intval($this->subject))
            ->where('students.user_id', auth()->user()->id)
            ->select(
                'meetings.name AS meeting_name',
                'meetings.date',
                'meetings.start_at',
                'meetings.end_at',
                "absences.status",
                "absences.created_at"
            );
    }
public function query ( Absences $ model ) { return $ model -> query ( ) -> join ( 'students' , 'students.id' , '=' , 'absences.student_id' ) -> join ( 'meetings' , 'meetings.id' , '=' , 'absences.meeting_id' ) -> where ( 'meetings.subject_id' , intval ( $ this -> subject ) ) -> where ( 'students.user_id' , auth ( ) -> user ( ) -> id ) -> select ( 'meetings.name AS meeting_name' , 'meetings.date' , 'meetings.start_at' , 'meetings.end_at' , " absences.status " , " absences.created_at " ) ; }
Get query source of dataTable.
Get query source of dataTable .