app/DataTables/StudentsDataTable.php
/**
     * Get query source of dataTable.
     *
     * @param \App\Models\Student $model
     * @return \Illuminate\Database\Eloquent\Builder
     */
Get query source of dataTable.
Get query source of dataTable .
public function query(Students $model)
    {
        return $model
            ->query()
            ->join('users', 'students.user_id', '=', 'users.id')
            ->select(
                "users.username",
                'users.email',
                'users.id AS user_id',
                'students.image',
                'students.firstname',
                'students.lastname',
                'students.student_id',
                'students.phone',
                'students.address',
                'students.country',
                'students.birthday',
                'students.status',
                'students.status',
                'students.city',
                'students.province',
                'students.reason',
                'students.id'
            );
    }
public function query ( Students $ model ) { return $ model -> query ( ) -> join ( 'users' , 'students.user_id' , '=' , 'users.id' ) -> select ( " users.username " , 'users.email' , 'users.id AS user_id' , 'students.image' , 'students.firstname' , 'students.lastname' , 'students.student_id' , 'students.phone' , 'students.address' , 'students.country' , 'students.birthday' , 'students.status' , 'students.status' , 'students.city' , 'students.province' , 'students.reason' , 'students.id' ) ; }
Get query source of dataTable.
Get query source of dataTable .