public function destroy(CalendarRequest $request, Calendar $calendar)
    {

        try {

            $t = $calendar->delete();

            return response()->json([
                'message'  => trans('messages.success.deleted', ['Module' => trans('calendar::calendar.name')]),
                'code'     => 202,
                'redirect' => trans_url('/admin/calendar/calendar/0'),
            ], 202);

        } catch (Exception $e) {

            return response()->json([
                'message'  => $e->getMessage(),
                'code'     => 400,
                'redirect' => trans_url('/admin/calendar/calendar/' . $calendar->getRouteKey()),
            ], 400);
        }

    }
public function destroy(CalendarRequest $request, Calendar $calendar)
    {

        try {

            $t = $calendar->delete();

            return response()->json([
                'message'  => trans('messages.success.deleted', ['Module' => trans('calendar::calendar.name')]),
                'code'     => 202,
                'redirect' => trans_url('/admin/calendar/calendar/0'),
            ], 202);

        } catch (Exception $e) {

            return response()->json([
                'message'  => $e->getMessage(),
                'code'     => 400,
                'redirect' => trans_url('/admin/calendar/calendar/' . $calendar->getRouteKey()),
            ], 400);
        }

    }
public function destroy ( CalendarRequest $ request , Calendar $ calendar ) { try { $ t = $ calendar -> delete ( ) ; return response ( ) -> json ( [ 'message' => trans ( 'messages.success.deleted' , [ 'Module' => trans ( 'calendar::calendar.name' ) ] ) , 'code' => 202 , 'redirect' => trans_url ( '/admin/calendar/calendar/0' ) , ] , 202 ) ; } catch ( Exception $ e ) { return response ( ) -> json ( [ 'message' => $ e -> getMessage ( ) , 'code' => 400 , 'redirect' => trans_url ( '/admin/calendar/calendar/' . $ calendar -> getRouteKey ( ) ) , ] , 400 ) ; } }
Remove the calendar.

@param Model   $calendar

@return Response
Remove the calendar .