src/Http/Controllers/Adminarea/ServiceBookingsController.php
public function destroy(Service $service, ServiceBooking $serviceBooking)
    {
        $service->bookings()->where($serviceBooking->getKeyName(), $serviceBooking->getKey())->first()->delete();

        return intend([
            'url' => route('adminarea.services.bookings.index'),
            'with' => [
                'warning' => trans('cortex/foundation::messages.resource_deleted', [
                    'resource' => trans('cortex/bookings::common.service_booking'),
                    'identifier' => $service->name.':'.$serviceBooking->id,
                ]),
            ],
        ]);

        return $serviceBooking->getKey();
    }
public function destroy(Service $service, ServiceBooking $serviceBooking)
    {
        $service->bookings()->where($serviceBooking->getKeyName(), $serviceBooking->getKey())->first()->delete();

        return intend([
            'url' => route('adminarea.services.bookings.index'),
            'with' => [
                'warning' => trans('cortex/foundation::messages.resource_deleted', [
                    'resource' => trans('cortex/bookings::common.service_booking'),
                    'identifier' => $service->name.':'.$serviceBooking->id,
                ]),
            ],
        ]);

        return $serviceBooking->getKey();
    }
public function destroy ( Service $ service , ServiceBooking $ serviceBooking ) { $ service -> bookings ( ) -> where ( $ serviceBooking -> getKeyName ( ) , $ serviceBooking -> getKey ( ) ) -> first ( ) -> delete ( ) ; return intend ( [ 'url' => route ( 'adminarea.services.bookings.index' ) , 'with' => [ 'warning' => trans ( 'cortex/foundation::messages.resource_deleted' , [ 'resource' => trans ( 'cortex/bookings::common.service_booking' ) , 'identifier' => $ service -> name . ':' . $ serviceBooking -> id , ] ) , ] , ] ) ; return $ serviceBooking -> getKey ( ) ; }
Destroy given booking.

@param \Cortex\Bookings\Models\Service        $service
@param \Cortex\Bookings\Models\ServiceBooking $serviceBooking

@throws \Exception

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
Destroy given booking .