<commit_before><?php

namespace App\Nova\Lenses;

use App\Nova\Team;
use App\Nova\Event;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Lenses\Lens;
use App\Nova\Filters\Attendable;
use Laravel\Nova\Fields\MorphTo;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Http\Requests\LensRequest;

class RecentInactiveUsers extends Lens
{
    /**
     * Get the query builder / paginator for the lens.
     *
     * @param  \Laravel\Nova\Http\Requests\LensRequest  $request
     * @param  \Illuminate\Database\Eloquent\Builder  $query
     * @return mixed
     */
    public static function query(LensRequest $request, $query)
    {
        return $request->withOrdering($request->withFilters(
            $query->whereDoesntHave('attendee', function ($q) {
                $q->active();
            })->where('attendable_type', 'App\Team')
            ->whereBetween('created_at', [now()->subDays(14)->startOfDay(), now()])
            ->select('gtid', 'attendable_id', 'attendable_type')
            ->distinct()
        ));
    }

    /**
     * Get the fields available to the lens.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function fields(Request $request)
    {
        return [
            Text::make('GTID')
                ->sortable(),

            BelongsTo::make('User', 'attendee', 'App\Nova\User')
                ->sortable(),

            MorphTo::make('Attended', 'attendable')
                ->sortable()
                ->types([
                    Event::class,
                    Team::class,
                ]),
        ];
    }

    /**
     * Get the filters available for the lens.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function filters(Request $request)
    {
        return [
            new Attendable(false),
        ];
    }

    /**
     * Get the URI key for the lens.
     *
     * @return string
     */
    public function uriKey()
    {<commit_msg>Fix #529 by disabling sort<commit_after><?php

namespace App\Nova\Lenses;

use App\Nova\Team;
use App\Nova\Event;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Lenses\Lens;
use App\Nova\Filters\Attendable;
use Laravel\Nova\Fields\MorphTo;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Http\Requests\LensRequest;

class RecentInactiveUsers extends Lens
{
    /**
     * Get the query builder / paginator for the lens.
     *
     * @param  \Laravel\Nova\Http\Requests\LensRequest  $request
     * @param  \Illuminate\Database\Eloquent\Builder  $query
     * @return mixed
     */
    public static function query(LensRequest $request, $query)
    {
        return $request->withOrdering($request->withFilters(
            $query->whereDoesntHave('attendee', function ($q) {
                $q->active();
            })->where('attendable_type', 'App\Team')
            ->whereBetween('created_at', [now()->subDays(14)->startOfDay(), now()])
            ->select('gtid', 'attendable_id', 'attendable_type')
            ->distinct()
        ));
    }

    /**
     * Get the fields available to the lens.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function fields(Request $request)
    {
        return [
            Text::make('GTID'),

            BelongsTo::make('User', 'attendee', 'App\Nova\User'),

            MorphTo::make('Attended', 'attendable')
                ->types([
                    Event::class,
                    Team::class,
                ]),
        ];
    }

    /**
     * Get the filters available for the lens.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function filters(Request $request)
    {
        return [
            new Attendable(false),
        ];
    }

    /**
     * Get the URI key for the lens.
     *
     * @return string
     */
    public function uriKey()
    {
{'fraction_non_alphanumeric': 0.13485685585133098, 'fraction_numerical': 0.0017579105976896032, 'mean_word_length': 1.9438285291943829, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1353308', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1231, 'n_words': 245}