public function deleteItemCondition(Request $request)
    {
        $this->validate(
            $request,
            [
                'item_condition_id' => 'required|integer|exists:item_conditions',
            ]
        );

        $item_condition = ItemCondition::find($request->input('item_condition_id'));

        if ($item_condition->items()->count()) {
            return redirect()->back()->withErrors(['item_condition_id' => trans('mustard::admin.item_condition_has_items')]);
        }

        $item_condition->delete();

        return redirect()->back()->withStatus(trans('mustard::admin.item_condition_deleted'));
    }
public function deleteItemCondition(Request $request)
    {
        $this->validate(
            $request,
            [
                'item_condition_id' => 'required|integer|exists:item_conditions',
            ]
        );

        $item_condition = ItemCondition::find($request->input('item_condition_id'));

        if ($item_condition->items()->count()) {
            return redirect()->back()->withErrors(['item_condition_id' => trans('mustard::admin.item_condition_has_items')]);
        }

        $item_condition->delete();

        return redirect()->back()->withStatus(trans('mustard::admin.item_condition_deleted'));
    }
public function deleteItemCondition ( Request $ request ) { $ this -> validate ( $ request , [ 'item_condition_id' => 'required|integer|exists:item_conditions' , ] ) ; $ item_condition = ItemCondition :: find ( $ request -> input ( 'item_condition_id' ) ) ; if ( $ item_condition -> items ( ) -> count ( ) ) { return redirect ( ) -> back ( ) -> withErrors ( [ 'item_condition_id' => trans ( 'mustard::admin.item_condition_has_items' ) ] ) ; } $ item_condition -> delete ( ) ; return redirect ( ) -> back ( ) -> withStatus ( trans ( 'mustard::admin.item_condition_deleted' ) ) ; }
Delete an item condition.

@return \Illuminate\Http\RedirectResponse
Delete an item condition .