public function bulkDelete(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('PostType', 'delete')) {
            return $this->noPermission();
        }
        // if there are no item selected
        if (count($request->all()) <= 0) {
            return $this->response('Please select items to be deleted', 500);
        }

        // loop throw the item array (ids) and delete them
        foreach($request->all() as $id){
            $res = $this->deletePostType($id);
            if(!$res) {
                return $this->response('Post Type could not be deleted. Please try again later or contact your Administrator!', 500);
            }
            if(!is_bool($res)) {
                return $res;
            }
        }
        return $this->response('Selected post types are successfully deleted', 200);
    }
public function bulkDelete(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('PostType', 'delete')) {
            return $this->noPermission();
        }
        // if there are no item selected
        if (count($request->all()) <= 0) {
            return $this->response('Please select items to be deleted', 500);
        }

        // loop throw the item array (ids) and delete them
        foreach($request->all() as $id){
            $res = $this->deletePostType($id);
            if(!$res) {
                return $this->response('Post Type could not be deleted. Please try again later or contact your Administrator!', 500);
            }
            if(!is_bool($res)) {
                return $res;
            }
        }
        return $this->response('Selected post types are successfully deleted', 200);
    }
public function bulkDelete ( Request $ request ) { // check if user has permissions to access this link if ( ! User :: hasAccess ( 'PostType' , 'delete' ) ) { return $ this -> noPermission ( ) ; } // if there are no item selected if ( count ( $ request -> all ( ) ) <= 0 ) { return $ this -> response ( 'Please select items to be deleted' , 500 ) ; } // loop throw the item array (ids) and delete them foreach ( $ request -> all ( ) as $ id ) { $ res = $ this -> deletePostType ( $ id ) ; if ( ! $ res ) { return $ this -> response ( 'Post Type could not be deleted. Please try again later or contact your Administrator!' , 500 ) ; } if ( ! is_bool ( $ res ) ) { return $ res ; } } return $ this -> response ( 'Selected post types are successfully deleted' , 200 ) ; }
Bulk Delete post type.
Delete many post type in the same time.

@param  Request $request
@return array
@throws \Exception
Bulk Delete post type . Delete many post type in the same time .