deletePost($post)) { return redirect()->route('admin.posts.index', $customPostType->slug) ->with('success', $customPostType->singular_name . ' deleted successfully.'); } return redirect()->route('admin.posts.index', $customPostType->slug) ->with('error', 'Failed to delete ' . $customPostType->singular_name . '.'); } }