app/DataTables/UsersDataTable.php
/**
     * Get query source of dataTable.
     *
     * @param \App\Models\User $model
     * @return \Illuminate\Database\Eloquent\Builder
     */
Get query source of dataTable.
Get query source of dataTable .
public function query(User $model)
    {
        return $model
            ->query()
            ->join('roles', 'users.role_id', '=', 'roles.id')
            ->select(
                "users.image",
                "users.id",
                "users.username",
                "users.email",
                "users.email_verified_at",
                "users.isOnline",
                "roles.name AS role_name"
            );
    }
public function query ( User $ model ) { return $ model -> query ( ) -> join ( 'roles' , 'users.role_id' , '=' , 'roles.id' ) -> select ( " users.image " , " users.id " , " users.username " , " users.email " , " users.email_verified_at " , " users.isOnline " , " roles.name AS role_name " ) ; }
Get query source of dataTable.
Get query source of dataTable .