app/DataTables/ClassroomsDataTable.php
/**
     * Get query source of dataTable.
     *
     * @param \App\Models\Classroom $model
     * @return \Illuminate\Database\Eloquent\Builder
     */
Get query source of dataTable.
Get query source of dataTable .
public function query(Classrooms $model)
    {
        return $model
            ->query()
            ->join('grades', 'grades.id',  '=', 'classrooms.grade_id')
            ->select('classrooms.id', 'classrooms.name', 'token', 'grades.name AS grade_name');
    }
public function query ( Classrooms $ model ) { return $ model -> query ( ) -> join ( 'grades' , 'grades.id' , '=' , 'classrooms.grade_id' ) -> select ( 'classrooms.id' , 'classrooms.name' , 'token' , 'grades.name AS grade_name' ) ; }
Get query source of dataTable.
Get query source of dataTable .