public function sortListingDurations(Request $request)
    {
        $this->validate(
            $request,
            [
                'listing_durations' => 'required|array',
            ]
        );

        foreach ($request->input('listing_durations') as $listing_duration_id => $sort) {
            $listing_duration = ListingDuration::find($listing_duration_id);

            $listing_duration->sort = $sort;

            $listing_duration->save();
        }

        return redirect()->back()->withStatus(trans('mustard::admin.listing_durations_sorted'));
    }
public function sortListingDurations(Request $request)
    {
        $this->validate(
            $request,
            [
                'listing_durations' => 'required|array',
            ]
        );

        foreach ($request->input('listing_durations') as $listing_duration_id => $sort) {
            $listing_duration = ListingDuration::find($listing_duration_id);

            $listing_duration->sort = $sort;

            $listing_duration->save();
        }

        return redirect()->back()->withStatus(trans('mustard::admin.listing_durations_sorted'));
    }
public function sortListingDurations ( Request $ request ) { $ this -> validate ( $ request , [ 'listing_durations' => 'required|array' , ] ) ; foreach ( $ request -> input ( 'listing_durations' ) as $ listing_duration_id => $ sort ) { $ listing_duration = ListingDuration :: find ( $ listing_duration_id ) ; $ listing_duration -> sort = $ sort ; $ listing_duration -> save ( ) ; } return redirect ( ) -> back ( ) -> withStatus ( trans ( 'mustard::admin.listing_durations_sorted' ) ) ; }
Sort listing durations.

@return \Illuminate\Http\RedirectResponse
Sort listing durations .