Code Duplication    Length = 15-16 lines in 2 locations

src/Http/Controllers/InventoryController.php 1 location

@@ 33-47 (lines=15) @@
30
     *
31
     * @return \Illuminate\Http\Response
32
     */
33
    public function index()
34
    {
35
        $inventories = DB::table('inventories')
36
        ->leftJoin('brand', 'inventories.brand_id', '=', 'brand.id')
37
        ->leftJoin('material_type', 'inventories.material_type_id', '=', 'material_type.id')
38
        ->leftJoin('brand_model', 'inventories.model_id', '=', 'brand_model.id')
39
        ->leftJoin('moneySource', 'inventories.moneySourceId', '=', 'moneySource.id')
40
        ->leftJoin('location', 'inventories.location_id', '=', 'location.id')
41
        ->leftJoin('provider', 'inventories.provider_id', '=', 'provider.id')
42
        ->select('inventories.*', 'material_type.name as material_type_name', 'material_type.id as material_type_id', 'brand.name as brand_name', 'brand.id as brand_id', 'brand_model.name as brand_model_name', 'brand_model.id as model_id', 'location.name as location_name', 'location.id as location_id', 'moneySource.name as moneySource_name', 'moneySource.id as moneySourceId',
43
        'provider.name as provider_name', 'provider.id as provider_id')
44
        ->paginate(5);
45
46
        return view('inventory/index', ['inventories' => $inventories]);
47
    }
48
49
    /**
50
     * Show the form for creating a new resource.

src/Models/InventoryController.php 1 location

@@ 33-48 (lines=16) @@
30
     *
31
     * @return \Illuminate\Http\Response
32
     */
33
    public function index()
34
    {
35
        $inventories = DB::table('inventories')
36
        ->leftJoin('brand', 'inventories.brand_id', '=', 'brand.id')
37
        ->leftJoin('material_type', 'inventories.material_type_id', '=', 'material_type.id')
38
        ->leftJoin('brand_model', 'inventories.model_id', '=', 'brand_model.id')
39
        ->leftJoin('moneySource', 'inventories.moneySourceId', '=', 'moneySource.id')
40
        ->leftJoin('location', 'inventories.location_id', '=', 'location.id')
41
        ->leftJoin('provider', 'inventories.provider_id', '=', 'provider.id')
42
        ->select('inventories.*', 'material_type.name as material_type_name', 'material_type.id as material_type_id', 'brand.name as brand_name', 'brand.id as brand_id',
43
        'brand_model.name as brand_model_name', 'brand_model.id as model_id', 'location.name as location_name', 'location.id as location_id',
44
        'moneySource.name as moneySource_name', 'moneySource.id as moneySourceId', 'provider.name as provider_name', 'provider.id as provider_id')
45
        ->paginate(5);
46
47
        return view('inventory/index', ['inventories' => $inventories]);
48
    }
49
50
    /**
51
     * Show the form for creating a new resource.