Code Duplication    Length = 14-14 lines in 2 locations

src/Http/Controllers/InventoryController.php 1 location

@@ 74-87 (lines=14) @@
71
     *
72
     * @return \Illuminate\Http\Response
73
     */
74
    public function store(Request $request)
75
    {
76
        $this->validateInput($request);
77
        // Upload image
78
        $path = $request->file('picture')->store('avatars');
79
        $keys = ['name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity', 'price',
80
        'moneysourceId', 'provider_id', 'date_entrance', 'last_update', ];
81
        $input = $this->createQueryInput($keys, $request);
82
        $input['picture'] = $path;
83
84
        Inventory::create($input);
85
86
        return redirect()->intended('/inventory-mnt');
87
    }
88
89
    /**
90
     * Display the specified resource.

src/Models/InventoryController.php 1 location

@@ 75-88 (lines=14) @@
72
     *
73
     * @return \Illuminate\Http\Response
74
     */
75
    public function store(Request $request)
76
    {
77
        $this->validateInput($request);
78
        // Upload image
79
        $path = $request->file('picture')->store('avatars');
80
        $keys = ['name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity', 'price',
81
        'moneysourceId', 'provider_id', 'date_entrance', 'last_update', ];
82
        $input = $this->createQueryInput($keys, $request);
83
        $input['picture'] = $path;
84
85
        Inventory::create($input);
86
87
        return redirect()->intended('/inventory-mnt');
88
    }
89
90
    /**
91
     * Display the specified resource.