<commit_before><?php

namespace App\Http\Controllers\Api;

use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AccessoriesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Accessory;
use App\Models\Company;
use App\Models\User;
use Carbon\Carbon;
use Auth;
use DB;
use Illuminate\Http\Request;
use App\Http\Requests\ImageUploadRequest;

class AccessoriesController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @author [<NAME>] [<<EMAIL>>]
     * @since [v4.0]
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $this->authorize('view', Accessory::class);
        
        // This array is what determines which fields should be allowed to be sorted on ON the table itself, no relations
        // Relations will be handled in query scopes a little further down.
        $allowed_columns = 
            [
                'id',
                'name',
                'model_number',
                'eol',
                'notes',
                'created_at',
                'min_amt',
                'company_id'
            ];


        $accessories = Accessory::with('category', 'company', 'manufacturer', 'users', 'location', 'supplier');

        if ($request->filled('search')) {<commit_msg>Fixed scoping with leftjoin<commit_after><?php

namespace App\Http\Controllers\Api;

use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AccessoriesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Accessory;
use App\Models\Company;
use App\Models\User;
use Carbon\Carbon;
use Auth;
use DB;
use Illuminate\Http\Request;
use App\Http\Requests\ImageUploadRequest;

class AccessoriesController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @author [<NAME>] [<<EMAIL>>]
     * @since [v4.0]
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $this->authorize('view', Accessory::class);
        
        // This array is what determines which fields should be allowed to be sorted on ON the table itself, no relations
        // Relations will be handled in query scopes a little further down.
        $allowed_columns = 
            [
                'id',
                'name',
                'model_number',
                'eol',
                'notes',
                'created_at',
                'min_amt',
                'company_id'
            ];


        $accessories = Accessory::select('accessories.*')->with('category', 'company', 'manufacturer', 'users', 'location', 'supplier');

        if ($request->filled('search')) {
{'fraction_non_alphanumeric': 0.11768979295314203, 'fraction_numerical': 0.001452960406828914, 'mean_word_length': 2.3180722891566266, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '2488835', 'n_tokens_mistral': 780, 'n_tokens_neox': 765, 'n_words': 201}